Fix rebuild command

This commit is contained in:
Stephan Kulow
2019-11-19 12:57:13 +01:00
parent 28ec31df5d
commit ffe92526fa
2 changed files with 5 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ class RebuildCommand(object):
def perform(self, stagings=None, force=False):
if not stagings:
stagings = self.api.get_staging_projects_short()
stagings = self.api.get_staging_projects()
for staging in stagings:
status = self.api.project_status(staging)

View File

@@ -772,12 +772,11 @@ class StagingAPI(object):
def rebuild_broken(self, status, check=True):
""" Rebuild broken packages given a staging's status information. """
for package in status['broken_packages']:
package = {k: str(v) for k, v in package.items()}
if package['state'] == 'unresolvable':
for package in status.findall('broken_packages/package'):
if package.get('state') == 'unresolvable':
continue
key = (package['project'], package['package'],
package['repository'], package['arch'])
key = (package.get('project'), package.get('package'),
package.get('repository'), package.get('arch'))
if check and not self.rebuild_check(*key):
yield (key, 'skipped')
continue