Make koha-enable handle errors more gracefully. Also make it support more than one instance as parameter (there is a for loop, but a previous check prevents it to work).
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