[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-06-01 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Jonathan Druart  changed:

   What|Removed |Added

 Blocks||25635


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25635
[Bug 25635] overdue_notices.pl dies if no overdue rules are defined
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-05-31 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

David Cook  changed:

   What|Removed |Added

 Blocks||25634


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25634
[Bug 25634] koha-foreach exits if 1 command has non-zero status
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-05-31 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

David Cook  changed:

   What|Removed |Added

 CC||dc...@prosentient.com.au

--- Comment #17 from David Cook  ---
This has a perhaps unforeseen consequence with koha-foreach.

Since koha-foreach uses "set -e", if 1 instance runs a command with koha-shell
which has a non-zero status, koha-foreach exits. If you have 10 instances and
the 1st produces an error, the other 9 instances won't have their commands run
at all.
(https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html#The-Set-Builtin)

I can't imagine that's what we'd want to do? I'll open a new bug report.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-04-14 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Hayley Mapley  changed:

   What|Removed |Added

 CC||hayleymap...@catalyst.net.n
   ||z

--- Comment #16 from Hayley Mapley  ---
Enhancement will not be backported to 18.11.x series

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-04-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Lucas Gass  changed:

   What|Removed |Added

 Version(s)|20.05.00, 19.11.05  |20.05.00, 19.11.05,
released in||19.05.10
 CC||lu...@bywatersolutions.com
 Status|Pushed to stable|Pushed to oldstable

--- Comment #15 from Lucas Gass  ---
backported to 19.05.x for 19.05.10

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-04-01 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Joy Nelson  changed:

   What|Removed |Added

 Status|Pushed to master|Pushed to stable
 CC||j...@bywatersolutions.com
 Version(s)|20.05.00|20.05.00, 19.11.05
released in||

--- Comment #14 from Joy Nelson  ---
Backported to 19.11.x for 19.11.05

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Martin Renvoize  changed:

   What|Removed |Added

 Version(s)||20.05.00
released in||
 Status|Passed QA   |Pushed to master

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-03 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

--- Comment #13 from Martin Renvoize  ---
Nice work everyone!

Pushed to master for 20.05

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Tomás Cohen Arazi  changed:

   What|Removed |Added

  Text to go in the||Before this development,
  release notes||the koha-shell script would
   ||always return a successful
   ||error code, making it hard
   ||for the callers to notice
   ||there was a problem with
   ||the command being run
   ||inside the instance's
   ||shell.
   ||
   ||This development
   ||makes koha-shell propagate
   ||the running scripts' error
   ||code so the caller can take
   ||the required actions.
   ||
   ||Note: this implies a
   ||behaviour change (for good)
   ||but a warning should be
   ||added to the release notes.
   ||
   ||Right now it always
   ||returns

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Martin Renvoize  changed:

   What|Removed |Added

  Attachment #99918|0   |1
is obsolete||

--- Comment #12 from Martin Renvoize  ---
Created attachment 99943
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99943=edit
Bug 17532: Make koha-shell propagate the error code

Context: I am trying to make koha-misc4dev stop when something wrong happens.
Basically we do not want the process to continue of the DB has not been
populated correctly.
It will make the errors easier to catch.

The issue: Say a script that will return an error (die in perl for an easy
example),
koha-shell will not return the 255 error code, but 0 instead.
The caller cannot know something wrong happened

The solution is to propagate the error and make koha-shell return the same
error code
as the command it executed

An example:
=== t.pl ===
die('something wrong');

% perl t.pl;echo $?
something wrong at t.pl line 1.
255

% sudo koha-shell kohadev -p -c 'perl xxx.pl' ; echo $?
something wrong at xxx.pl line 1.
0

Signed-off-by: Tomas Cohen Arazi 
Tested it with
  $ sudo debian/scripts/koha-shell kohadev -c 'exit 8'
  $ echo $?
  8
The unpatched version returns 0 (forgets about the error code).

Signed-off-by: Martin Renvoize 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Martin Renvoize  changed:

   What|Removed |Added

 Status|Signed Off  |Passed QA

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

--- Comment #11 from Jonathan Druart  
---
s/regressions/side-effects
;)

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

--- Comment #10 from Tomás Cohen Arazi  ---
(In reply to Jonathan Druart from comment #9)
> I should note:
> I have no idea how widely this script is used, but that will certainly
> introduced regressions for people using it.
> For Jenkins that will stop the build if something wrong happens during the
> insert of the data in the DB (expected behavior).

I think it is worth changing the (currently) wrong behaviour. It will even help
sysadmins using it detect problems. We should of course mention this on the
release notes.

Good catch (as usual), Jonathan.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

--- Comment #9 from Jonathan Druart  
---
I should note:
I have no idea how widely this script is used, but that will certainly
introduced regressions for people using it.
For Jenkins that will stop the build if something wrong happens during the
insert of the data in the DB (expected behavior).

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Tomás Cohen Arazi  changed:

   What|Removed |Added

  Attachment #98808|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

--- Comment #8 from Tomás Cohen Arazi  ---
Created attachment 99918
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99918=edit
Bug 17532: Make koha-shell propagate the error code

Context: I am trying to make koha-misc4dev stop when something wrong happens.
Basically we do not want the process to continue of the DB has not been
populated correctly.
It will make the errors easier to catch.

The issue: Say a script that will return an error (die in perl for an easy
example),
koha-shell will not return the 255 error code, but 0 instead.
The caller cannot know something wrong happened

The solution is to propagate the error and make koha-shell return the same
error code
as the command it executed

An example:
=== t.pl ===
die('something wrong');

% perl t.pl;echo $?
something wrong at t.pl line 1.
255

% sudo koha-shell kohadev -p -c 'perl xxx.pl' ; echo $?
something wrong at xxx.pl line 1.
0

Signed-off-by: Tomas Cohen Arazi 
Tested it with
  $ sudo debian/scripts/koha-shell kohadev -c 'exit 8'
  $ echo $?
  8
The unpatched version returns 0 (forgets about the error code).

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Tomás Cohen Arazi  changed:

   What|Removed |Added

 Status|Needs Signoff   |Signed Off

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-03-02 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

--- Comment #7 from Martin Renvoize  ---
This looks pretty sensible and sane to me

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-02-26 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Jonathan Druart  changed:

   What|Removed |Added

 CC||martin.renvoize@ptfs-europe
   ||.com,
   ||n...@bywatersolutions.com,
   ||tomasco...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-02-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

--- Comment #6 from Jonathan Druart  
---
Do you see any issues this change could cause?

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-02-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Jonathan Druart  changed:

   What|Removed |Added

  Attachment #57055|0   |1
is obsolete||

--- Comment #5 from Jonathan Druart  
---
Created attachment 98808
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98808=edit
Bug 17532: Make koha-shell propagate the error code

Context: I am trying to make koha-misc4dev stop when something wrong happens.
Basically we do not want the process to continue of the DB has not been
populated correctly.
It will make the errors easier to catch.

The issue: Say a script that will return an error (die in perl for an easy
example),
koha-shell will not return the 255 error code, but 0 instead.
The caller cannot know something wrong happened

The solution is to propagate the error and make koha-shell return the same
error code
as the command it executed

An example:
=== t.pl ===
die('something wrong');

% perl t.pl;echo $?
something wrong at t.pl line 1.
255

% sudo koha-shell kohadev -p -c 'perl xxx.pl' ; echo $?
something wrong at xxx.pl line 1.
0

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-02-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Jonathan Druart  changed:

   What|Removed |Added

 Status|REOPENED|Needs Signoff

--- Comment #4 from Jonathan Druart  
---
Context: I am trying to make koha-misc4dev stop when something wrong happens.
Basically we do not want the process to continue of the DB has not been
populated correctly.
It will make the errors easier to catch.

The issue: Say a script that will return an error (die in perl for an easy
example), koha-shell will not return the 255 error code, but 0 instead. The
caller cannot know something wrong happened

The solution is to propagate the error and make koha-shell return the same
error code as the command it executed

An example:
=== t.pl ===
die('something wrong');

% perl t.pl;echo $?
something wrong at t.pl line 1.
255

% sudo koha-shell kohadev -p -c 'perl xxx.pl' ; echo $?
something wrong at xxx.pl line 1.
0

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2020-02-13 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Jonathan Druart  changed:

   What|Removed |Added

 Status|CLOSED  |REOPENED
 Resolution|INVALID |---

--- Comment #3 from Jonathan Druart  
---
Reviving this one.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2016-11-01 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

--- Comment #1 from Jonathan Druart  
---
Created attachment 57055
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57055=edit
Bug 17532: Make koha-shell -c propagate the error code

When you execute a command using koha-shell -c, you would like to get
the error code of the command you executed.
It seems that koha-shell does not do that.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2016-11-01 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Jonathan Druart  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|ASSIGNED|RESOLVED

--- Comment #2 from Jonathan Druart  
---
Not sure about this, in my last tests it worked as expected.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/


[Koha-bugs] [Bug 17532] koha-shell -c does not propagate the error code

2016-11-01 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17532

Jonathan Druart  changed:

   What|Removed |Added

Summary|koha-shell does not |koha-shell -c does not
   |propagate the error code|propagate the error code

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/