From 382f2e28971b9c2d87730d42b5cfd15db6e3fcf2 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Thu, 9 Dec 2010 20:36:06 +0100 Subject: [PATCH] - wc_repair: check if passed apiurl is valid - do_repairwc: get apiurls from conf.config.api_host_options dict --- osc/commandline.py | 3 +-- osc/core.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 4b389752..f2d33b85 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6135,8 +6135,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. args = parseargs(args) pacs = [] - cp = conf.get_configParser(conf.config['conffile']) - apiurls = [i.rstrip('/') for i in cp.sections() if i != 'general'] + apiurls = conf.config['api_host_options'].keys() apiurl = '' for i in args: if is_project_dir(i): diff --git a/osc/core.py b/osc/core.py index 6ff3958d..302f2cc4 100644 --- a/osc/core.py +++ b/osc/core.py @@ -476,6 +476,8 @@ class Project: 'no \'apiurl\' was passed to wc_repair' # hmm should we raise oscerr.WrongArgs? raise oscerr.WorkingCopyInconsistent(self.prjname, self.name, [], msg) + # sanity check + conf.parse_apisrv_url(None, apiurl) store_write_apiurl(self.dir, apiurl) self.apiurl = store_read_apiurl(self.dir, defaulturl=False) @@ -905,6 +907,8 @@ class Package: 'no \'apiurl\' was passed to wc_repair' # hmm should we raise oscerr.WrongArgs? raise oscerr.WorkingCopyInconsistent(self.prjname, self.name, [], msg) + # sanity check + conf.parse_apisrv_url(None, apiurl) store_write_apiurl(self.dir, apiurl) self.apiurl = store_read_apiurl(self.dir, defaulturl=False) # all files which are present in the filelist have to exist in the storedir