openSUSE-release-tools/osclib/rebuild_command.py
Jimmy Berry 13b7ae9d8a osc-staging: provide rebuild command.
Often packages will fail to build after becoming stuck or other false
negative cases and need to have a rebuild triggered. The process can be
tedious if several packages failed in various stages.
2017-03-08 16:17:31 -06:00

18 lines
526 B
Python

from osc.core import get_request
from osclib.comments import CommentAPI
class RebuildCommand(object):
def __init__(self, api):
self.api = api
def perform(self, stagings=None):
if not stagings:
stagings = self.api.get_staging_projects_short()
for staging in stagings:
status = self.api.project_status(staging)
rebuilt = self.api.rebuild_broken(status)
for key, code in rebuilt.items():
print('rebuild {} {}'.format(key, code))