Bug 18548 - running koha-create --request-db without an instance name should abort
Summary: running koha-create --request-db without an instance name should abort
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All Linux
: P5 - low minor (vote)
Assignee: Josef Moravec
QA Contact: Testopia
URL:
Whiteboard:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2017-05-05 09:47 UTC by Eric Vantillard
Modified: 2017-06-05 12:19 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18548: Print usage when missing instance name in koha-create script (917 bytes, patch)
2017-05-05 10:23 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18548: Print usage when missing instance name in koha-create script (867 bytes, patch)
2017-05-09 06:32 UTC, Josef Moravec
Details | Diff | Splinter Review
Screenshot after applying patch - not working (176.03 KB, image/png)
2017-05-10 06:31 UTC, Dilan Johnpullé
Details
Bug 18548: Print usage when missing instance name in koha-create script (826 bytes, patch)
2017-05-17 06:22 UTC, Dilan Johnpullé
Details | Diff | Splinter Review
Bug 18548: Print usage when missing instance name in koha-create script (1001 bytes, patch)
2017-05-19 16:38 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Vantillard 2017-05-05 09:47:22 UTC
running `koha-create --request-db` without an instance name will exit with this error message

getent: invalid option -- 'k'
Try `getent --help' or `getent --usage' for more information.
[...]

It should detect that the instance name is missing and exit with an error message explaining that the instance name is mandatory
Comment 1 Josef Moravec 2017-05-05 10:23:17 UTC
Created attachment 63159 [details] [review]
Bug 18548: Print usage when missing instance name in koha-create script

Test plan:
1. Run: debian/scripts/koha-create --request-db
-> Without patch you see the getent error message
-> With patch you see usage and "Missing instance name" message
Comment 2 Eric Vantillard 2017-05-05 11:31:55 UTC
test done. it's fine. thank you
Comment 3 Josef Moravec 2017-05-05 11:42:52 UTC
(In reply to Eric Vantillard from comment #2)
> test done. it's fine. thank you

Please note:
"RESOLVED FIXED" status is for bugs pushed to all relevant versions, if you test it and it works for you, you should use "signed off" status.

See https://wiki.koha-community.org/wiki/Development_workflow

anyway thanks for testing!
Comment 4 Eric Vantillard 2017-05-05 11:45:09 UTC
understood. thanks
Comment 5 Jonathan Druart 2017-05-05 16:01:20 UTC
Josef,
Regarding `git grep -i "missing instance" debian/scripts/` I'd suggest to follow the same pattern:
  [ $# -ge 1 ] || ( usage ; die "Missing instance name..." )
Comment 6 Josef Moravec 2017-05-05 18:32:07 UTC
(In reply to Jonathan Druart from comment #5)
> Josef,
> Regarding `git grep -i "missing instance" debian/scripts/` I'd suggest to
> follow the same pattern:
>   [ $# -ge 1 ] || ( usage ; die "Missing instance name..." )

thanks Jonathan, I'll make new patch...
Comment 7 Josef Moravec 2017-05-09 06:32:59 UTC
Created attachment 63278 [details] [review]
Bug 18548: Print usage when missing instance name in koha-create script

Test plan:
1. Run: debian/scripts/koha-create --request-db
-> Without patch you see the getent error message
-> With patch you see usage and "Missing instance name" message
Comment 8 Dilan Johnpullé 2017-05-10 05:06:37 UTC
Just tried it Josef. It's still giving a 'getent [...]' message instead.
Comment 9 Josef Moravec 2017-05-10 05:35:36 UTC
(In reply to dilan from comment #8)
> Just tried it Josef. It's still giving a 'getent [...]' message instead.

Can't help it, but it works for me... how do you try to test it? On devbox?
Comment 10 Dilan Johnpullé 2017-05-10 06:31:05 UTC
Created attachment 63319 [details]
Screenshot after applying patch - not working

Yeah on a devbox. Have a look at the attachment. This is the message I get after applying the patch.
Comment 11 Josef Moravec 2017-05-10 07:11:49 UTC
(In reply to dilan from comment #10)
> Created attachment 63319 [details]
> Screenshot after applying patch - not working
> 
> Yeah on a devbox. Have a look at the attachment. This is the message I get
> after applying the patch.

On devbox you should run it as 

debian/scripts/koha-create

because that's the modified file - the koha-create in system is that one installled by package - so old version
Comment 12 Dilan Johnpullé 2017-05-17 06:22:09 UTC
Created attachment 63495 [details] [review]
Bug 18548: Print usage when missing instance name in koha-create script

My apologies Josef, you are correct. It works prefectly with the right command.
Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>
Comment 13 Jonathan Druart 2017-05-19 16:38:50 UTC
Created attachment 63581 [details] [review]
Bug 18548: Print usage when missing instance name in koha-create script

Test plan:
1. Run: debian/scripts/koha-create --request-db
-> Without patch you see the getent error message
-> With patch you see usage and "Missing instance name" message

Signed-off-by: Dilan Johnpulle <dilan@calyx.net.au>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Kyle M Hall 2017-05-24 14:25:14 UTC
Pushed to master for 17.05, thanks Josef!
Comment 15 Katrin Fischer 2017-06-05 12:19:47 UTC
This patch has been pushed to 16.11.x and will be in 16.11.09.