1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-10-07 09:30:05 +02:00

- escape attributes

This commit is contained in:
Marcus Huewe
2009-12-29 20:33:16 +01:00
parent d75888fbd4
commit f109054898

View File

@@ -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('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
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