Permalink
Browse files

new config param rpm_upload_cmd_one_call to upload all rpms with one …

…call
  • Loading branch information...
1 parent c87a917 commit ea39a71947302947272230bea490c8a4f420a9f9 @heroldus heroldus committed Aug 27, 2012
Showing with 12 additions and 6 deletions.
  1. +12 −6 src/config_rpm_maker/__init__.py
@@ -152,13 +152,19 @@ def _build_hosts(self, hosts):
def _upload_rpms(self, rpms):
rpm_upload_cmd = config.get('rpm_upload_cmd')
+ one_call = config.get('rpm_upload_cmd_one_call', True)
if rpm_upload_cmd:
- for rpm in rpms:
- cmd = rpm_upload_cmd + ' ' + rpm
- p = subprocess.Popen(cmd, shell=True)
- p.communicate()
- if p.returncode:
- raise Exception('Could not upload rpm %s . Returned: %d', (rpm, p.returncode))
+ if one_call:
+ cmd = '%s %s' % (rpm_upload_cmd, ' '.join(rpms))
+ returncode = subprocess.call(cmd, shell=True)
+ if returncode:
+ raise Exception('Could not upload rpms. Called %s . Returned: %d', (cmd, returncode))
+ else:
+ for rpm in rpms:
+ cmd = '%s %s' % (rpm_upload_cmd, rpm)
+ returncode = subprocess.call(cmd, shell=True)
+ if returncode:
+ raise Exception('Could not upload rpm. Called %s . Returned: %d', (cmd, returncode))
def _get_affected_hosts(self, change_set, available_host):
result = set()

0 comments on commit ea39a71

Please sign in to comment.