[Bug 18709] New: koha-foreach should use koha-shell, internally
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Bug ID: 18709 Summary: koha-foreach should use koha-shell, internally Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: gmcharlt@gmail.com Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz Highlighted by bug 17717, koha-foreach is currently taking care of crafting all env variables and call sudo to run the required tasks. We should definitely call koha-shell in there, and have a single place in which to take care of this logic. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17717 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 64680 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64680&action=edit Bug 18709: Make koha-foreach use koha-shell internally This patch simplifies the koha-foreach script, making it use koha-shell to gain instance privileges and have all environment variables set. To test: - Apply the patch - Have one or more instances created (kohadev already exists in kohadevbox, add another onewith $ sudo koha-create --create-db test) - Run: $ sudo kohaclone/debian/scripts/koha-foreach echo "This is instance __instancename__" => SUCCESS: The script runs gracefuly, and outputs something like: This is instance kohadev This is instance test Note: this means the command was executed for each instance and the current behaviour of replacing the placeholder __instancename__ for the actual instance name still works as expected. - You can try the different filter switches, but the logic has not been touched. only the command call. - Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mirko@abunchofthings.net Component|Command-line Utilities |Packaging Assignee|gmcharlt@gmail.com |koha-bugs@lists.koha-commun | |ity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Packaging |Command-line Utilities -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64680|0 |1 is obsolete| | --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 67372 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67372&action=edit Bug 18709: Make koha-foreach use koha-shell internally This patch simplifies the koha-foreach script, making it use koha-shell to gain instance privileges and have all environment variables set. To test: - Apply the patch - Have one or more instances created (kohadev already exists in kohadevbox, add another onewith $ sudo koha-create --create-db test) - Run: $ sudo kohaclone/debian/scripts/koha-foreach echo "This is instance __instancename__" => SUCCESS: The script runs gracefuly, and outputs something like: This is instance kohadev This is instance test Note: this means the command was executed for each instance and the current behaviour of replacing the placeholder __instancename__ for the actual instance name still works as expected. - You can try the different filter switches, but the logic has not been touched. only the command call. - Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67372|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 67920 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67920&action=edit Bug 18709: Make koha-foreach use koha-shell internally This patch simplifies the koha-foreach script, making it use koha-shell to gain instance privileges and have all environment variables set. To test: - Apply the patch - Have one or more instances created (kohadev already exists in kohadevbox, add another onewith $ sudo koha-create --create-db test) - Run: $ sudo kohaclone/debian/scripts/koha-foreach echo "This is instance __instancename__" => SUCCESS: The script runs gracefuly, and outputs something like: This is instance kohadev This is instance test Note: this means the command was executed for each instance and the current behaviour of replacing the placeholder __instancename__ for the actual instance name still works as expected. - You can try the different filter switches, but the logic has not been touched. only the command call. - Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolin.somers@biblibre.co | |m --- Comment #5 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.05.x for v17.05.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org