Commit 13a1d8ea authored by Romain Courteaud's avatar Romain Courteaud

Fix encoding usage in setConnectionXml

parent f437c484
...@@ -1152,16 +1152,16 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1152,16 +1152,16 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
slave_reference = self.start_requested_slave_instance.getReference() slave_reference = self.start_requested_slave_instance.getReference()
connection_xml = """<marshal> connection_xml = """<marshal>
<dictionary id="i2"> <dictionary id="i2">
<string>p1</string> <unicode>p1é</unicode>
<string>v1</string> <unicode>v1é</unicode>
<string>p2</string> <unicode>p2é</unicode>
<string>v2</string> <unicode>v2é</unicode>
</dictionary> </dictionary>
</marshal>""" </marshal>"""
stored_xml = """<?xml version='1.0' encoding='utf-8'?> stored_xml = """<?xml version='1.0' encoding='utf-8'?>
<instance> <instance>
<parameter id="p2">v2</parameter> <parameter id="p1é">v1é</parameter>
<parameter id="p1">v1</parameter> <parameter id="p2é">v2é</parameter>
</instance> </instance>
""" """
self.login(self.start_requested_software_instance.getReference()) self.login(self.start_requested_software_instance.getReference())
...@@ -1185,16 +1185,16 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1185,16 +1185,16 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
portal_type='Computer Partition').getReference() portal_type='Computer Partition').getReference()
connection_xml = """<marshal> connection_xml = """<marshal>
<dictionary id="i2"> <dictionary id="i2">
<string>p1</string> <unicode>p1é</unicode>
<string>v1</string> <unicode>v1é</unicode>
<string>p2</string> <unicode>p2é</unicode>
<string>v2</string> <unicode>v2é</unicode>
</dictionary> </dictionary>
</marshal>""" </marshal>"""
stored_xml = """<?xml version='1.0' encoding='utf-8'?> stored_xml = """<?xml version='1.0' encoding='utf-8'?>
<instance> <instance>
<parameter id="p2">v2</parameter> <parameter id="p1é">v1é</parameter>
<parameter id="p1">v1</parameter> <parameter id="p2é">v2é</parameter>
</instance> </instance>
""" """
self.login(self.start_requested_software_instance.getReference()) self.login(self.start_requested_software_instance.getReference())
...@@ -2390,4 +2390,4 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin): ...@@ -2390,4 +2390,4 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
self.assertRevokeComputerCertificateSimulator((), {}) self.assertRevokeComputerCertificateSimulator((), {})
finally: finally:
if os.path.exists(self.revoke_computer_certificate_simulator): if os.path.exists(self.revoke_computer_certificate_simulator):
os.unlink(self.revoke_computer_certificate_simulator) os.unlink(self.revoke_computer_certificate_simulator)
\ No newline at end of file
26 27
\ No newline at end of file \ No newline at end of file
...@@ -1047,8 +1047,6 @@ class SlapTool(BaseTool): ...@@ -1047,8 +1047,6 @@ class SlapTool(BaseTool):
connection_xml) connection_xml)
instance = etree.Element('instance') instance = etree.Element('instance')
for parameter_id, parameter_value in partition_parameter_kw.iteritems(): for parameter_id, parameter_value in partition_parameter_kw.iteritems():
# cast everything to string
parameter_value = str(parameter_value)
etree.SubElement(instance, "parameter", etree.SubElement(instance, "parameter",
attrib={'id':parameter_id}).text = parameter_value attrib={'id':parameter_id}).text = parameter_value
connection_xml = etree.tostring(instance, pretty_print=True, connection_xml = etree.tostring(instance, pretty_print=True,
......
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