Lazy evaluation the ring projects
So we can use the StagingAPI also for projects below the target project Fixes #1626
This commit is contained in:
parent
27f0056e8d
commit
b40036fb71
@ -74,6 +74,7 @@ class StagingAPI(object):
|
|||||||
|
|
||||||
# Store some prefix / data used in the code.
|
# Store some prefix / data used in the code.
|
||||||
self.user = conf.get_apiurl_usr(apiurl)
|
self.user = conf.get_apiurl_usr(apiurl)
|
||||||
|
self._rings = None
|
||||||
self._ring_packages = None
|
self._ring_packages = None
|
||||||
self._ring_packages_for_links = None
|
self._ring_packages_for_links = None
|
||||||
self._packages_staged = None
|
self._packages_staged = None
|
||||||
@ -81,15 +82,6 @@ class StagingAPI(object):
|
|||||||
self._supersede = False
|
self._supersede = False
|
||||||
self._package_disabled = {}
|
self._package_disabled = {}
|
||||||
|
|
||||||
# If the project support rings, inititialize some variables.
|
|
||||||
if self.crings:
|
|
||||||
self.rings = (
|
|
||||||
'{}:0-Bootstrap'.format(self.crings),
|
|
||||||
'{}:1-MinimalX'.format(self.crings)
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
self.rings = []
|
|
||||||
|
|
||||||
Cache.init()
|
Cache.init()
|
||||||
|
|
||||||
def __getattr__(self, attr):
|
def __getattr__(self, attr):
|
||||||
@ -110,6 +102,21 @@ class StagingAPI(object):
|
|||||||
# Raise AttributeError like normal.
|
# Raise AttributeError like normal.
|
||||||
return self.__getattribute__(attr)
|
return self.__getattribute__(attr)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rings(self):
|
||||||
|
if self._rings is None:
|
||||||
|
|
||||||
|
# If the project support rings, inititialize some variables.
|
||||||
|
if self.crings:
|
||||||
|
self._rings = (
|
||||||
|
'{}:0-Bootstrap'.format(self.crings),
|
||||||
|
'{}:1-MinimalX'.format(self.crings)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self._rings = []
|
||||||
|
|
||||||
|
return self._rings
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ring_packages(self):
|
def ring_packages(self):
|
||||||
if self._ring_packages is None:
|
if self._ring_packages is None:
|
||||||
@ -1838,4 +1845,3 @@ class StagingAPI(object):
|
|||||||
|
|
||||||
def expanded_repos(self, repo):
|
def expanded_repos(self, repo):
|
||||||
return self.expand_project_repo(self.project, repo, [])
|
return self.expand_project_repo(self.project, repo, [])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user