mirror of
https://github.com/openSUSE/osc.git
synced 2025-10-07 09:30:05 +02:00
- escape attributes
This commit is contained in:
@@ -565,13 +565,14 @@ class Osc(cmdln.Cmdln):
|
||||
if cmd == 'attribute':
|
||||
if not opts.attribute:
|
||||
sys.exit('no attribute given to create')
|
||||
values=""
|
||||
values= ''
|
||||
if opts.set:
|
||||
for i in opts.set.split(','):
|
||||
values+="<value>%s</value>" % i
|
||||
d="""<attributes><attribute name='%s' >%s</attribute></attributes>""" % (opts.attribute, values)
|
||||
opts.set = opts.set.replace('&', '&').replace('<', '<').replace('>', '>')
|
||||
for i in opts.set.split(','):
|
||||
values += '<value>%s</value>' % i
|
||||
d = '<attributes><attribute name=\'%s\' >%s</attribute></attributes>' % (opts.attribute, values)
|
||||
url = makeurl(conf.config['apiurl'], attributepath)
|
||||
f=http_POST(url, data=d)
|
||||
f = http_POST(url, data=d)
|
||||
while 1:
|
||||
buf = f.read(16384)
|
||||
if not buf: break
|
||||
|
Reference in New Issue
Block a user