No longer default to all scopes but make it configurable

By default only generate the pkglists for the target project, only
for leap we configure rings and stagings as additional scopes to look
at
This commit is contained in:
Stephan Kulow 2018-12-04 04:40:28 +01:00
parent c31c259530
commit ee72a3efb0
2 changed files with 12 additions and 9 deletions

View File

@ -98,6 +98,7 @@ DEFAULT = {
# - F-C-C submitter requests (maxlin_factory) # - F-C-C submitter requests (maxlin_factory)
'unselect-cleanup-whitelist': 'leaper maxlin_factory', 'unselect-cleanup-whitelist': 'leaper maxlin_factory',
'pkglistgen-archs': 'x86_64', 'pkglistgen-archs': 'x86_64',
'pkglistgen-scopes': 'target rings staging',
'pkglistgen-locales-from': 'openSUSE.product', 'pkglistgen-locales-from': 'openSUSE.product',
'pkglistgen-include-suggested': 'False', 'pkglistgen-include-suggested': 'False',
'pkglistgen-delete-kiwis-rings': 'openSUSE-ftp-ftp-x86_64.kiwi openSUSE-cd-mini-x86_64.kiwi', 'pkglistgen-delete-kiwis-rings': 'openSUSE-ftp-ftp-x86_64.kiwi openSUSE-cd-mini-x86_64.kiwi',

View File

@ -1174,9 +1174,17 @@ class CommandLineInterface(ToolBase.CommandLineInterface):
raise ValueError('project is required') raise ValueError('project is required')
opts.staging_project = None opts.staging_project = None
apiurl = conf.config['apiurl']
config = Config(apiurl, opts.project)
target_config = conf.config[opts.project]
if apiurl.find('suse.de') > 0:
# used by product converter
os.environ['OBS_NAME'] = 'build.suse.de'
# special case for all # special case for all
if opts.scope == ['all']: if opts.scope == ['all']:
opts.scope = self.SCOPES[1:] opts.scope = target_config.get('pkglistgen-scopes', 'target').split(' ')
for scope in opts.scope: for scope in opts.scope:
if scope.startswith('staging:'): if scope.startswith('staging:'):
@ -1186,23 +1194,17 @@ class CommandLineInterface(ToolBase.CommandLineInterface):
if scope not in self.SCOPES: if scope not in self.SCOPES:
raise ValueError('scope "{}" must be one of: {}'.format(scope, ', '.join(self.SCOPES))) raise ValueError('scope "{}" must be one of: {}'.format(scope, ', '.join(self.SCOPES)))
opts.scope = scope opts.scope = scope
self.real_update_and_solve(copy.deepcopy(opts)) self.real_update_and_solve(target_config, copy.deepcopy(opts))
return self.error_occured return self.error_occured
# note: scope is a value here - while it's an array above # note: scope is a value here - while it's an array above
def real_update_and_solve(self, opts): def real_update_and_solve(self, target_config, opts):
# Store target project as opts.project will contain subprojects. # Store target project as opts.project will contain subprojects.
target_project = opts.project target_project = opts.project
apiurl = conf.config['apiurl'] apiurl = conf.config['apiurl']
config = Config(apiurl, target_project)
api = StagingAPI(apiurl, target_project) api = StagingAPI(apiurl, target_project)
if apiurl.find('suse.de') > 0:
# used by product converter
os.environ['OBS_NAME'] = 'build.suse.de'
target_config = conf.config[target_project]
archs_key = 'pkglistgen-archs' archs_key = 'pkglistgen-archs'
if archs_key in target_config: if archs_key in target_config: