X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=logger.py;h=17ae04c91f6811abc25360dbc7f7c8c6419c7c7c;hb=f085bc647d686cb86d21b66440d76e0e6e2cd704;hp=3fedde98dbabdf92dcba10d2728a6c9121ef773a;hpb=0f579d47b091e314de4790c4b71dabe6366c08ea;p=nodemanager.git diff --git a/logger.py b/logger.py index 3fedde9..17ae04c 100644 --- a/logger.py +++ b/logger.py @@ -43,7 +43,12 @@ def log(msg,level=LOG_NODE): def log_call(*args): log('running command %s' % ' '.join(args)) - try: subprocess.check_call(args, close_fds=True) + try: + child = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) + child.wait() # wait for proc to hang up + if child.returncode: + raise Exception("command failed:\n stdout - %s\n stderr - %s" % \ + (child.stdout.readlines(), child.stderr.readlines())) except: log_exc() def log_exc(name = None):