Summary: | koha-enable error handling | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi <tomascohen> |
Component: | Packaging | Assignee: | Chris Cormack <chris> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, mtj, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | Sponsored | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | |||
Bug Blocks: | 4876 | ||
Attachments: |
Bug 10101 - make koha-enable more robust
Signed off patch Bug 10101 - Follwup: fix param check Follow up signed off Bug 10101 - Follwup: fix param check Bug 10101 - make koha-enable more robust Bug 10101 - Follwup: fix param check |
Description
Tomás Cohen Arazi
2013-04-23 14:54:55 UTC
Created attachment 17618 [details] [review] Bug 10101 - make koha-enable more robust koha-enable now: - checks for the existence of the instance before any other action on it. - checks if the instance is already enabled before changing stuff in the config files. - only reloads apache if it is needed! - handles more than one instance name as parameter (the code was there, a check for the cardinality of the args prevented it from working). - documents this behaviour change in the docs - doesn't break if the provided (invalid) instance name is a prefix/suffix of a real one (added -x to the relevant grep command). To test: - Aplpy the patch, build your packages - Run koha-enable on - Non existent instance (try using a prefix or a suffix of an already created one too). - Already enabled existent instance name. - Disabled instance. Regards To+ Sponsored-by: Universidad Nacional de Córdoba sudo ./debian/scripts/koha-enable sfa Unknown instance sfa. sudo ./debian/scripts/koha-enable sfa persona Unknown instance sfa. [....] Restarting web server: apache2 ok sudo ./debian/scripts/koha-enable persona Instance persona already enabled. Created attachment 17776 [details] [review] Signed off patch (In reply to comment #3) > Created attachment 17776 [details] [review] [review] > Signed off patch a small QA question, this patch breaks the default 'usage' message, when no arg is passed - is this intended? -[ "$#" = 1 ] || die "Usage: $0 instancename..." +[ "$#" > 1 ] || die "Usage: $0 instancename..." before... # koha-enable Usage: /usr/sbin/koha-enable instancename... after... # koha-enable # Created attachment 17811 [details] [review] Bug 10101 - Follwup: fix param check As Mason noted, there was an error on that line. Sponsored-by: Universidad Nacional de Córdoba sudo ./debian/scripts/koha-enable Enables Koha instances. Usage: ./debian/scripts/koha-enable instancename1 instancename2... Missing instance name... Created attachment 17820 [details] [review] Follow up signed off Created attachment 17834 [details] [review] Bug 10101 - Follwup: fix param check As Mason noted, there was an error on that line. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Mason James <mtj@kohaaloha.com> Created attachment 17835 [details] [review] Bug 10101 - make koha-enable more robust koha-enable now: - checks for the existence of the instance before any other action on it. - checks if the instance is already enabled before changing stuff in the config files. - only reloads apache if it is needed! - handles more than one instance name as parameter (the code was there, a check for the cardinality of the args prevented it from working). - documents this behaviour change in the docs - doesn't break if the provided (invalid) instance name is a prefix/suffix of a real one (added -x to the relevant grep command). To test: - Aplpy the patch, build your packages - Run koha-enable on - Non existent instance (try using a prefix or a suffix of an already created one too). - Already enabled existent instance name. - Disabled instance. Regards To+ Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Mason James <mtj@kohaaloha.com> Created attachment 17836 [details] [review] Bug 10101 - Follwup: fix param check As Mason noted, there was an error on that line. Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Mason James <mtj@kohaaloha.com> (In reply to comment #10) > Created attachment 17836 [details] [review] [review] > Bug 10101 - Follwup: fix param check > > As Mason noted, there was an error on that line. > > Sponsored-by: Universidad Nacional de Córdoba > Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> > Signed-off-by: Mason James <mtj@kohaaloha.com> passing QA on 2 patches This patch has been pushed to master and 3.12.x. Pushed to 3.10.x will be in 3.10.6 |