Commit 95394a0b authored by Cédric de Saint Martin's avatar Cédric de Saint Martin Committed by Rafael Monnerat

Slapproxy: encode slave_instance_list when processing it.

No unicode is accepted as XML input, according to specification. So we convert to utf-8.
parent d46e09c4
......@@ -73,6 +73,9 @@ def dict2xml(dictionary):
def partitiondict2partition(partition):
for key, value in partition.iteritems():
if type(value) is unicode:
partition[key] = value.encode()
slap_partition = ComputerPartition(app.config['computer_id'],
partition['reference'])
slap_partition._software_release_document = None
......@@ -433,7 +436,7 @@ def request_slave():
if slave_instance_list is None:
slave_instance_list = []
else:
slave_instance_list = xml_marshaller.xml_marshaller.loads(slave_instance_list)
slave_instance_list = xml_marshaller.xml_marshaller.loads(slave_instance_list.encode())
for x in slave_instance_list:
if x['slave_reference'] == slave_reference:
slave_instance_list.remove(x)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment