From d04c758e0160604991b08f42d215eb18acea92ea Mon Sep 17 00:00:00 2001 From: Serge Rehbinder Date: Wed, 11 Jan 2017 15:05:07 +0100 Subject: [PATCH] Add verbisity to the shell command --- commands/shell.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/commands/shell.py b/commands/shell.py index b246072..e01d32b 100644 --- a/commands/shell.py +++ b/commands/shell.py @@ -46,14 +46,24 @@ def run(args, runner, logger): message = _("The option --command is required\n") logger.write(src.printcolors.printcError(message)) return 1 - + + # Print the input command + msg = _("Command to execute:\n%s\nExecution ... " % options.command) + logger.write(msg, 3) + + # Call the input command res = subprocess.call(options.command, shell=True, stdout=logger.logTxtFile, stderr=subprocess.STDOUT) - + # Format the result to be 0 (success) or 1 (fail) if res != 0: res = 1 + logger.write(src.printcolors.printc("KO"), 3) + else: + logger.write(src.printcolors.printc("OK"), 3) + + logger.write("\n",3) return res \ No newline at end of file -- 2.39.2