2017-03-08 16:03:27 -06:00
|
|
|
from osc.core import get_request
|
|
|
|
from osclib.comments import CommentAPI
|
|
|
|
|
|
|
|
|
|
|
|
class RebuildCommand(object):
|
|
|
|
def __init__(self, api):
|
|
|
|
self.api = api
|
|
|
|
|
2017-03-10 22:17:54 -06:00
|
|
|
def perform(self, stagings=None, force=False):
|
2017-03-08 16:03:27 -06:00
|
|
|
if not stagings:
|
|
|
|
stagings = self.api.get_staging_projects_short()
|
|
|
|
|
|
|
|
for staging in stagings:
|
|
|
|
status = self.api.project_status(staging)
|
2017-03-10 22:17:54 -06:00
|
|
|
rebuilt = self.api.rebuild_broken(status, not force)
|
2017-04-20 23:10:05 -05:00
|
|
|
for key, code in rebuilt:
|
2017-03-08 16:03:27 -06:00
|
|
|
print('rebuild {} {}'.format(key, code))
|