Merge pull request #858 from jberry-suse/splitter-staging-whitelist

request_splitter: add staging whitelist config option.
This commit is contained in:
Jimmy Berry 2017-04-28 17:19:16 -05:00 committed by GitHub
commit b2bde651cd
2 changed files with 7 additions and 1 deletions

View File

@ -43,6 +43,7 @@ DEFAULT = {
'openqa': 'https://openqa.opensuse.org',
'lock': 'openSUSE:%(project)s:Staging',
'lock-ns': 'openSUSE',
'splitter-whitelist': 'B C D E F G',
},
r'openSUSE:(?P<project>Leap:[\d.]+)': {
'staging': 'openSUSE:%(project)s:Staging',

View File

@ -2,6 +2,7 @@ from datetime import datetime
import dateutil.parser
import hashlib
from lxml import etree as ET
from osc import conf
import re
class RequestSplitter(object):
@ -202,7 +203,11 @@ class RequestSplitter(object):
# Use specified list of stagings, otherwise only empty, letter stagings.
if len(stagings) == 0:
stagings = self.api.get_staging_projects_short()
whitelist = conf.config[self.api.project].get('splitter-whitelist')
if whitelist:
stagings = whitelist.split()
else:
stagings = self.api.get_staging_projects_short()
should_always = False
else:
# If the an explicit list of stagings was included then always