[Koha-bugs] [Bug 18709] koha-foreach should use koha-shell, internally

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 11 02:16:46 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18709

Nick Clemens <nick at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #67372|0                           |1
        is obsolete|                            |

--- Comment #3 from Nick Clemens <nick at 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 at bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick at bywatersolutions.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list