[Bug 10101] New: koha-enable error handling
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Bug ID: 10101 Summary: koha-enable error handling Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Packaging Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com CC: robin@catalyst.net.nz 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). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Blocks| |4876 Change sponsored?|--- |Sponsored Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 17618 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17618&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17618|0 |1 is obsolete| | Status|Needs Signoff |Signed Off Assignee|tomascohen@gmail.com |chris@bigballofwax.co.nz --- Comment #3 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 17776 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17776&action=edit Signed off patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #4 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #3)
Created attachment 17776 [details] [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 # -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 17811 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17811&action=edit Bug 10101 - Follwup: fix param check As Mason noted, there was an error on that line. Sponsored-by: Universidad Nacional de Córdoba -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #6 from Chris Cormack <chris@bigballofwax.co.nz> --- sudo ./debian/scripts/koha-enable Enables Koha instances. Usage: ./debian/scripts/koha-enable instancename1 instancename2... Missing instance name... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17811|0 |1 is obsolete| | --- Comment #7 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 17820 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17820&action=edit Follow up signed off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17776|0 |1 is obsolete| | Attachment #17820|0 |1 is obsolete| | --- Comment #8 from Mason James <mtj@kohaaloha.com> --- Created attachment 17834 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17834&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 --- Comment #9 from Mason James <mtj@kohaaloha.com> --- Created attachment 17835 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17835&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17834|0 |1 is obsolete| | --- Comment #10 from Mason James <mtj@kohaaloha.com> --- Created attachment 17836 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17836&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 --- Comment #11 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #10)
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>
passing QA on 2 patches -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #12 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master and 3.12.x. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10101 --- Comment #13 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.10.x will be in 3.10.6 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org