1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

- wc_repair: check if passed apiurl is valid

- do_repairwc: get apiurls from conf.config.api_host_options dict
This commit is contained in:
Marcus Huewe 2010-12-09 20:36:06 +01:00
parent 71bedd4bb1
commit de25822a33
2 changed files with 5 additions and 2 deletions

View File

@ -6144,8 +6144,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):

View File

@ -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