osclib/cycle: remove need for StagingApi instance in favor of apiurl.

This commit is contained in:
Jimmy Berry 2018-10-18 16:15:09 -05:00
parent 2a50b8cf72
commit c74e40ba70
2 changed files with 4 additions and 4 deletions

View File

@ -129,8 +129,8 @@ class Package(object):
class CycleDetector(object):
"""Class to detect cycles in an OBS project."""
def __init__(self, api):
self.api = api
def __init__(self, apiurl):
self.apiurl = apiurl
# Store packages prevoiusly ignored. Don't pollute the screen.
self._ignore_packages = set()
@ -138,7 +138,7 @@ class CycleDetector(object):
root = None
try:
# print('Generating _builddepinfo for (%s, %s, %s)' % (project, repository, arch))
url = makeurl(self.api.apiurl, ['build/%s/%s/%s/_builddepinfo' % (project, repository, arch)])
url = makeurl(self.apiurl, ['build/%s/%s/%s/_builddepinfo' % (project, repository, arch)])
root = http_GET(url).read()
except urllib2.HTTPError as e:
print('ERROR in URL %s [%s]' % (url, e))

View File

@ -297,7 +297,7 @@ class RepoChecker(ReviewBot.ReviewBot):
self.logger.info('cycle check: start')
comment = []
first = True
cycle_detector = CycleDetector(self.staging_api(overridden_pair[0]))
cycle_detector = CycleDetector(self.apiurl)
for index, (cycle, new_edges, new_packages) in enumerate(
cycle_detector.cycles(override_pair, overridden_pair, arch), start=1):