From a8b66fc847fe7ee161544fedb132dc1d659d5277 Mon Sep 17 00:00:00 2001 From: Mathias Klette Date: Tue, 5 Jun 2012 16:30:30 +0200 Subject: [PATCH] changes --- debian_build.py | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/debian_build.py b/debian_build.py index 2f06b0d..071f1e6 100755 --- a/debian_build.py +++ b/debian_build.py @@ -113,34 +113,27 @@ def read_file(path): return result def dput_package_upload(changes_path): - cmd = [BIN_DPUT, '-c', '%s' %(DPUT_CF), '--no-upload-log', 'profitbricks', '%s' %(changes_path)] - logger.debug( - 'Trying to execute: "%s"' - %(cmd) - ) - cmd_obj = subprocess.Popen( - cmd, - shell=False, - stdout=sys.stdout, - stderr=sys.stderr, - close_fds=True, - cwd=os.path.dirname(DPUT_CF) - ) + try: + cmd = [BIN_DPUT, '-c', '%s' %(DPUT_CF), '--no-upload-log', 'profitbricks', '%s' %(changes_path)] + logger.debug( 'Trying to execute: "%s"' %(cmd)) + cmd_obj = subprocess.Popen( + cmd, + shell=False, + stdout=sys.stdout, + stderr=subprocess.STDOUT, + close_fds=True, + cwd=os.path.dirname(DPUT_CF) + ) - ret = cmd_obj.wait() + ret = cmd_obj.wait() + logger.debug('Exit status: %d' %( ret )) - if ret: - message = ( - '"%s" returned non-zero (returned with: %s).' - %(' '.join(cmd), ret) - ) - logger.debug(message) - raise Exception(message) + if ret: + raise Exception(message) + + except Exception, error: + logger.exception('%s' %(error)) - message = ( - '"%s" returned zero.' %(' '.join(cmd)) - ) - logger.debug(message) return True def create_dput_cfg(): -- 2.39.5