mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-25 22:36:13 +01:00
- don't crash on invalid attribute names
This commit is contained in:
parent
09a7f60ede
commit
00286be354
@ -735,6 +735,8 @@ class Osc(cmdln.Cmdln):
|
|||||||
for i in opts.set.split(','):
|
for i in opts.set.split(','):
|
||||||
values += '<value>%s</value>' % i
|
values += '<value>%s</value>' % i
|
||||||
aname = opts.attribute.split(":")
|
aname = opts.attribute.split(":")
|
||||||
|
if len(aname) != 2:
|
||||||
|
raise oscerr.WrongOptions('Given attribute is not in "NAMESPACE:NAME" style')
|
||||||
d = '<attributes><attribute namespace=\'%s\' name=\'%s\' >%s</attribute></attributes>' % (aname[0], aname[1], values)
|
d = '<attributes><attribute namespace=\'%s\' name=\'%s\' >%s</attribute></attributes>' % (aname[0], aname[1], values)
|
||||||
url = makeurl(apiurl, attributepath)
|
url = makeurl(apiurl, attributepath)
|
||||||
for data in streamfile(url, http_POST, data=d):
|
for data in streamfile(url, http_POST, data=d):
|
||||||
|
Loading…
Reference in New Issue
Block a user