Merge pull request #298 from aplanas/master

Properly set the Config call.
This commit is contained in:
Stephan Kulow 2015-02-20 13:20:49 +01:00
commit df8eeb3277
2 changed files with 9 additions and 4 deletions

View File

@ -25,6 +25,7 @@ from osc import cmdln
# Expand sys.path to search modules inside the pluging directory # Expand sys.path to search modules inside the pluging directory
PLUGINDIR = os.path.dirname(os.path.realpath(__file__.replace('.pyc', '.py'))) PLUGINDIR = os.path.dirname(os.path.realpath(__file__.replace('.pyc', '.py')))
sys.path.append(PLUGINDIR) sys.path.append(PLUGINDIR)
from osclib.conf import Config
from osclib.stagingapi import StagingAPI from osclib.stagingapi import StagingAPI
@ -375,6 +376,7 @@ def do_check_source(self, subcmd, opts, *args):
self._devel_projects = {} self._devel_projects = {}
opts.apiurl = self.get_api_url() opts.apiurl = self.get_api_url()
Config('openSUSE:%s' % opts.project)
self.api = StagingAPI(opts.apiurl, 'openSUSE:%s' % opts.project) self.api = StagingAPI(opts.apiurl, 'openSUSE:%s' % opts.project)
if len(args) and args[0] == 'skip': if len(args) and args[0] == 'skip':

View File

@ -22,7 +22,7 @@ import osc
# Expand sys.path to search modules inside the pluging directory # Expand sys.path to search modules inside the pluging directory
PLUGINDIR = os.path.expanduser(os.path.dirname(os.path.realpath(__file__))) PLUGINDIR = os.path.expanduser(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(PLUGINDIR) sys.path.append(PLUGINDIR)
from osclib.conf import Config
from osclib.stagingapi import StagingAPI from osclib.stagingapi import StagingAPI
@ -38,6 +38,7 @@ class ToTestBase(object):
def __init__(self, project, dryrun): def __init__(self, project, dryrun):
self.project = project self.project = project
self.dryrun = dryrun self.dryrun = dryrun
Config('openSUSE:%s' % project)
self.api = StagingAPI(osc.conf.config['apiurl'], project='openSUSE:%s' % project) self.api = StagingAPI(osc.conf.config['apiurl'], project='openSUSE:%s' % project)
self.known_failures = self.known_failures_from_dashboard(project) self.known_failures = self.known_failures_from_dashboard(project)
@ -167,7 +168,7 @@ class ToTestBase(object):
f = self.api.retried_GET(url) f = self.api.retried_GET(url)
root = ET.parse(f).getroot() root = ET.parse(f).getroot()
for repo in root.findall('result'): for repo in root.findall('result'):
if repo.get('repository') == 'ports': if repo.get('repository') == 'ports':
continue continue
if repo.get('dirty', '') == 'true': if repo.get('dirty', '') == 'true':
print repo.get('project'), repo.get('repository'), repo.get('arch'), 'dirty' print repo.get('project'), repo.get('repository'), repo.get('arch'), 'dirty'
@ -320,7 +321,7 @@ class ToTestBase(object):
print 'current_snapshot', current_snapshot, self._result2str(current_result) print 'current_snapshot', current_snapshot, self._result2str(current_result)
can_release = (current_result != QA_INPROGRESS and self.factory_snapshottable()) can_release = (current_result != QA_INPROGRESS and self.factory_snapshottable())
# not overwriting # not overwriting
if new_snapshot == current_snapshot: if new_snapshot == current_snapshot:
can_release = False can_release = False
@ -350,6 +351,7 @@ class ToTestBase(object):
known_failures.append(line.strip()) known_failures.append(line.strip())
return known_failures return known_failures
class ToTestFactory(ToTestBase): class ToTestFactory(ToTestBase):
main_products = ['_product:openSUSE-dvd5-dvd-i586', main_products = ['_product:openSUSE-dvd5-dvd-i586',
'_product:openSUSE-dvd5-dvd-x86_64', '_product:openSUSE-dvd5-dvd-x86_64',
@ -378,6 +380,7 @@ class ToTestFactory(ToTestBase):
return result.group(1) return result.group(1)
raise Exception("can't find factory version") raise Exception("can't find factory version")
class ToTest132(ToTestBase): class ToTest132(ToTestBase):
main_products = ['_product:openSUSE-dvd5-dvd-i586', main_products = ['_product:openSUSE-dvd5-dvd-i586',
'_product:openSUSE-dvd5-dvd-x86_64', '_product:openSUSE-dvd5-dvd-x86_64',
@ -418,7 +421,7 @@ if __name__ == '__main__':
parser.print_help() parser.print_help()
exit(-1) exit(-1)
osc.conf.get_config() #osc.conf.get_config()
#osc.conf.config['debug'] = True #osc.conf.config['debug'] = True
totest = totest_class[args.project](args.project, args.dryrun) totest = totest_class[args.project](args.project, args.dryrun)