else:
logger.warn('%s failed.' % command)
figlet('apt01 upload failed')
- return
+ return False
(head, tail) = os.path.splitext(changes_file)
new_changes_file = head + '_apt01' + tail
filehandle = open(new_changes_file, 'w')
cmd = ['dput', apt_target, new_changes_file]
command = ' '.join(cmd)
logger.debug('Executing "{command}" ...'.format(command=command))
- if subprocess.call(cmd) == 0:
+ success = subprocess.call(cmd) == 0
+ if success:
logger.debug('%s succeeded.' % command)
figlet('apt01 upload OK')
else:
logger.warn('%s failed.' % command)
figlet('apt01 upload failed')
except Exception as error:
- logger.warning("Experimental upload to http://apt01.pb.local failed. "
+ logger.warning("Upload to http://apt01.pb.local failed. "
"See above for details.", exc_info=error)
figlet('apt01 upload failed')
+ success = False
+ return success
if __name__ == '__main__':
fh.close()
# upload to new apt01 archive
- upload_to_apt_repository(apt_target, apt_dist, changes_file, logger)
+ if not upload_to_apt_repository(apt_target, apt_dist, changes_file, logger):
+ exit_error()
# upload changes file
dput_obj.configure()