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.
18 lines
526 B
Python
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))
|