mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 10:46:15 +01:00
- api now sends HTTP/1.1 400 Bad Request for invalid xml. Thus, show the reply
body because it contains helpful info. - repair linkpac for the new metadata editing facilities. copypac still seems to work.
This commit is contained in:
parent
5284a9b783
commit
b5e1dec8ad
@ -815,6 +815,12 @@ class Osc(cmdln.Cmdln):
|
|||||||
args = parseargs(args)
|
args = parseargs(args)
|
||||||
pacs = findpacs(args)
|
pacs = findpacs(args)
|
||||||
|
|
||||||
|
# this is experimental in that it enables a different way of uploading files
|
||||||
|
# see osc.core.Package.put_source_file()
|
||||||
|
# I assume that if -m is used, we want to commit this way.
|
||||||
|
if opts.message:
|
||||||
|
conf.config['do_commits'] = True
|
||||||
|
|
||||||
for p in pacs:
|
for p in pacs:
|
||||||
|
|
||||||
if conf.config['do_commits']:
|
if conf.config['do_commits']:
|
||||||
|
15
osc/core.py
15
osc/core.py
@ -933,8 +933,13 @@ class metafile:
|
|||||||
return True
|
return True
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
# internal server error (probably the xml file is incorrect)
|
# internal server error (probably the xml file is incorrect)
|
||||||
|
if e.code == 400:
|
||||||
|
print >>sys.stderr, 'Cannot save meta data.'
|
||||||
|
print >>sys.stderr, e
|
||||||
|
print >>sys.stderr, e.read()
|
||||||
|
return False
|
||||||
if e.code == 500:
|
if e.code == 500:
|
||||||
print >>sys.stderr, 'cannot save meta data - probably your xml file is incorrect'
|
print >>sys.stderr, 'Cannot save meta data. Unknown error.'
|
||||||
print >>sys.stderr, e
|
print >>sys.stderr, e
|
||||||
# this may be unhelpful... because it may just print a big blob of uninteresting
|
# this may be unhelpful... because it may just print a big blob of uninteresting
|
||||||
# ichain html and javascript... however it could potentially be useful if the orign
|
# ichain html and javascript... however it could potentially be useful if the orign
|
||||||
@ -1222,18 +1227,16 @@ def link_pac(src_project, src_package, dst_project, dst_package):
|
|||||||
# and create the package
|
# and create the package
|
||||||
tree = ET.parse(StringIO(''.join(src_meta)))
|
tree = ET.parse(StringIO(''.join(src_meta)))
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
root.set('name', '%s')
|
root.set('name', dst_package)
|
||||||
root.set('project', dst_project)
|
root.set('project', dst_project)
|
||||||
tree.find('person').set('userid', '%s')
|
tree.find('person').set('userid', conf.config['user'])
|
||||||
buf = StringIO()
|
buf = StringIO()
|
||||||
tree.write(buf)
|
tree.write(buf)
|
||||||
src_meta = buf.getvalue()
|
src_meta = buf.getvalue()
|
||||||
|
|
||||||
#edit_meta(dst_project, dst_package, template=src_meta)
|
|
||||||
edit_meta('pkg',
|
edit_meta('pkg',
|
||||||
input=src_meta,
|
|
||||||
path_args=(dst_project, dst_package),
|
path_args=(dst_project, dst_package),
|
||||||
template_args=(dst_package, conf.config['user']))
|
data=src_meta)
|
||||||
|
|
||||||
# create the _link file
|
# create the _link file
|
||||||
# but first, make sure not to overwrite an existing one
|
# but first, make sure not to overwrite an existing one
|
||||||
|
Loading…
Reference in New Issue
Block a user