diff --git a/osc/build.py b/osc/build.py index 2aaf45d8..826f07cd 100644 --- a/osc/build.py +++ b/osc/build.py @@ -345,7 +345,7 @@ def check_trusted_projects(apiurl, projects): config['api_host_options'][apiurl]['trusted_prj'] = trusted conf.config_set_option(apiurl, 'trusted_prj', ' '.join(trusted)) -def main(opts, argv): +def main(apiurl, opts, argv): repo = argv[0] arch = argv[1] @@ -433,7 +433,6 @@ def main(opts, argv): pac = '_repository' else: pac = store_read_package(os.curdir) - apiurl = store_read_apiurl(os.curdir) # make it possible to override configuration of the rc file for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'OSC_BUILD_ROOT']: diff --git a/osc/commandline.py b/osc/commandline.py index a5860048..24992c7b 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -3780,7 +3780,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. f.close() else: project = alternative_project or store_read_project('.') - repositories = get_repositories_of_project(store_read_apiurl('.'), project) + apiurl = self.get_api_url() + repositories = get_repositories_of_project(apiurl, project) if not len(repositories): raise oscerr.WrongArgs('no repositories defined for project \'%s\'' % project) try: @@ -3984,7 +3985,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. raise oscerr.WrongOptions('--offline and --preload are mutually exclusive') print 'Building %s for %s/%s' % (args[2], args[0], args[1]) - return osc.build.main(opts, args) + return osc.build.main(self.get_api_url(), opts, args) @cmdln.option('--local-package', action='store_true',