]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
we don't mind if rm fails
authorMathias Klette <mathias.klette@profitbricks.com>
Wed, 16 May 2012 18:15:33 +0000 (20:15 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Wed, 16 May 2012 18:15:33 +0000 (20:15 +0200)
debian_build.py

index 6196349221df4504fbdfb8ba683045f9c2a9e69c..0fb93f910f8a143a223d7297dfb3ab06a903bbff 100755 (executable)
@@ -290,7 +290,8 @@ if __name__ == '__main__':
         files = [os.path.join(BUILD_AREA,file) for file in fnmatch.filter(os.listdir(BUILD_AREA),'*.orig.tar.gz')]
         if len(files) > 0:
             logger.debug('Previous upstream tarball(s) found: %s' %( files ))
-            cmd = [BIN_SUDO, BIN_RM, '-v', " ".join(files)]
+            cmd = [BIN_SUDO, BIN_RM, '-v']
+            cmd.extend(files)
             cmdobj = subprocess.Popen(
                     cmd,
                     shell=False,
@@ -304,15 +305,8 @@ if __name__ == '__main__':
             logger.debug('Calling "%s":' %(' '.join(cmd)))
             ret = cmdobj.wait()
             for line in cmdobj.stdout.readlines():
-                logger.debug('%s' %(line))
-
-            if ret:
-                _str = (
-                    'Cmd "%s" returned non-zero (exitcode: %s).'
-                    %(' '.join(cmd), ret)
-                )
-                logger.debug(_str)
-                raise Exception(_str)
+                logger.debug('%s' %(line.strip()))
+            logger.debug('Cmd returned with status %d' %(cmdobj.returncode))
 
     ## #if GIT_BRANCH_NAME != 'master':
     ## if not git_helper.git_new_branch_from(localname,remotename):