1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-23 05:26:16 +01:00

- do_repourls: do not hardcode the download_url

Instead ask the api for the download_url configuration element.
This commit is contained in:
Marcus Huewe 2015-06-29 23:59:59 +02:00
parent 9ba540e348
commit cbdc1389db
2 changed files with 11 additions and 2 deletions

View File

@ -3981,8 +3981,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
else: else:
raise oscerr.WrongArgs('Wrong number of arguments') raise oscerr.WrongArgs('Wrong number of arguments')
# XXX: API should somehow tell that root = ET.fromstring(''.join(show_configuration(apiurl)))
url_tmpl = 'http://download.opensuse.org/repositories/%s/%s/%s.repo' elm = root.find('download_url')
if elm is None or not elm.text:
raise oscerr.APIError('download_url configuration element expected')
url_tmpl = elm.text + '/%s/%s/%s.repo'
repos = get_repositories_of_project(apiurl, project) repos = get_repositories_of_project(apiurl, project)
for repo in repos: for repo in repos:
print(url_tmpl % (project.replace(':', ':/'), repo, project)) print(url_tmpl % (project.replace(':', ':/'), repo, project))

View File

@ -3447,6 +3447,11 @@ def show_pattern_meta(apiurl, prj, pattern):
e.osc_msg = 'show_pattern_meta: Error getting pattern \'%s\' for project \'%s\'' % (pattern, prj) e.osc_msg = 'show_pattern_meta: Error getting pattern \'%s\' for project \'%s\'' % (pattern, prj)
raise raise
def show_configuration(apiurl):
u = makeurl(apiurl, ['public', 'configuration'])
f = http_GET(u)
return f.readlines()
class metafile: class metafile:
"""metafile that can be manipulated and is stored back after manipulation.""" """metafile that can be manipulated and is stored back after manipulation."""