raise Exception('unhandled branch, failing.')
# cleanup existing *orig.tar.gz
- files = " ".join(fnmatch.filter(os.listdir('../build-area/'),'*.orig.tar.gz'))
- cmd = [BIN_SUDO, BIN_RM, '-f', files]
- cmdobj = subprocess.Popen(
- cmd,
- shell=False,
- cwd='/',
- close_fds=True,
- stdout=sys.stdout,
- stderr=sys.stderr,
- env={'':''}
- )
-
- logger.debug(
- 'Trying to call "%s"'
- %(' '.join(cmd))
- )
-
- ret = cmdobj.wait()
- if ret:
- _str = (
- 'Cmd "%s" returned non-zero (exitcode: %s).'
- %(' '.join(cmd), ret)
+ if os.os.path.isdir('../build-area/'):
+ files = " ".join(fnmatch.filter(os.listdir('../build-area/'),'*.orig.tar.gz'))
+ cmd = [BIN_SUDO, BIN_RM, '-f', files]
+ cmdobj = subprocess.Popen(
+ cmd,
+ shell=False,
+ cwd='/',
+ close_fds=True,
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ env={'':''}
+ )
+
+ logger.debug(
+ 'Trying to call "%s"'
+ %(' '.join(cmd))
)
- logger.debug(_str)
- raise Exception(_str)
+
+ ret = cmdobj.wait()
+ if ret:
+ _str = (
+ 'Cmd "%s" returned non-zero (exitcode: %s).'
+ %(' '.join(cmd), ret)
+ )
+ logger.debug(_str)
+ raise Exception(_str)
logger.info('dist: %s' %(pb_suite))