[elbe-devel] [PATCH v2 4/6] shellhelper: Fix get_command_out()
Torben Hohn
torben.hohn at linutronix.de
Wed Jun 3 10:55:48 CEST 2020
On Mon, May 25, 2020 at 02:25:54PM -0400, Olivier Dion wrote:
> Fixed an error in the second 'Popen' of get_command_out(). For some
> reason, stdout was redirected to elbe's logging when stdin is not
> None.
>
> Signed-off-by: Olivier Dion <dion at linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>
> ---
> elbepack/shellhelper.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/elbepack/shellhelper.py b/elbepack/shellhelper.py
> index 12b7673c..bc5f608b 100644
> --- a/elbepack/shellhelper.py
> +++ b/elbepack/shellhelper.py
> @@ -300,10 +300,10 @@ def get_command_out(cmd, stdin=None, allow_fail=False, env_add={}):
> if stdin is None:
> p = Popen(cmd, shell=True, stdout=PIPE, stderr=w, env=new_env)
> else:
> - p = Popen(cmd, shell=True, stdin=PIPE, stdout=w, stderr=STDOUT, env=new_env)
> + p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=w, env=new_env)
>
> async_logging(r, w, soap, log)
> - stdout, stderr = p.communicate(input=stdin)
> + stdout, _ = p.communicate(input=stdin)
>
> if p.returncode and not allow_fail:
> raise CommandError(cmd, p.returncode)
> --
> 2.26.2
>
>
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel
--
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/kontakt/Datenschutz.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
More information about the elbe-devel
mailing list