[elbe-devel] [PATCH v2 01/15] Change os.sytem to shellhelper::system for "check_updates.py"
Torben Hohn
torben.hohn at linutronix.de
Tue Jun 25 13:41:23 CEST 2019
On Mon, Jun 24, 2019 at 05:38:58PM +0200, dion at linutronix.de wrote:
> From: Olivier Dion <dion at linutronix.de>
>
> Signed-off-by: Olivier Dion <dion at linutronix.de>
> ---
> elbepack/commands/check_updates.py | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/elbepack/commands/check_updates.py b/elbepack/commands/check_updates.py
> index 2e5da5a1..beabe70d 100644
> --- a/elbepack/commands/check_updates.py
> +++ b/elbepack/commands/check_updates.py
> @@ -7,7 +7,6 @@
>
> from __future__ import print_function
>
> -import os
> import sys
>
> from optparse import OptionParser
> @@ -16,6 +15,7 @@ from elbepack.treeutils import etree
> from elbepack import virtapt
> from elbepack.validate import validate_xml
> from elbepack.xmldefaults import ElbeDefaults
> +from elbepack.shellhelper import system
>
>
> def run_command(argv):
> @@ -114,10 +114,10 @@ def run_command(argv):
> if errors > 0:
> print("%d Errors occured, xml files needs fixing" % errors)
> if opt.script:
> - os.system("%s ERRORS %s" % (opt.script, args[0]))
> + system("%s ERRORS %s" % (opt.script, args[0]))
this runs a script provided by the user.
Its currently unspecified, what shall happen, when this script returns
non zero.
lets use allow_fail=True here.
I am going to touch this code next week, so i can catch the Exception,
and report an error then.
> elif required_updates > 0:
> print("%d updates required" % required_updates)
> if opt.script:
> - os.system("%s UPDATE %s" % (opt.script, args[0]))
> + system("%s UPDATE %s" % (opt.script, args[0]))
> else:
> print("No Updates available")
> --
> 2.11.0
>
>
> _______________________________________________
> 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