Don't use namespaces - they don't work consistencya cross Python versions.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/0e231a41 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/0e231a41 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/0e231a41 Branch: refs/heads/trunk Commit: 0e231a419cb66282b7362a7a508b17e65627f144 Parents: ca470b6 Author: Tomaz Muraus <[email protected]> Authored: Sun Apr 5 17:15:20 2015 +0200 Committer: Tomaz Muraus <[email protected]> Committed: Sun Apr 5 17:15:20 2015 +0200 ---------------------------------------------------------------------- libcloud/compute/drivers/azure.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/0e231a41/libcloud/compute/drivers/azure.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/azure.py b/libcloud/compute/drivers/azure.py index e29be39..38397f0 100644 --- a/libcloud/compute/drivers/azure.py +++ b/libcloud/compute/drivers/azure.py @@ -2616,13 +2616,17 @@ class AzureXmlSerializer(object): Wraps the specified xml in an xml root element with default azure namespaces """ + # Note: Namespaces don't work consistency in Python 2 and 3. + """ nsmap = { None: "http://www.w3.org/2001/XMLSchema-instance", "i": "http://www.w3.org/2001/XMLSchema-instance" } - xml = ET.Element(document_element_name, nsmap=nsmap) - # xml.attrib["xmlns:i"] = "http://www.w3.org/2001/XMLSchema-instance" - # xml.attrib["xmlns"] = "http://schemas.microsoft.com/windowsazure" + + xml.attrib["xmlns:i"] = "http://www.w3.org/2001/XMLSchema-instance" + xml.attrib["xmlns"] = "http://schemas.microsoft.com/windowsazure" + """ + xml = ET.Element(document_element_name) if inner_xml is not None: xml.append(inner_xml) @@ -3285,7 +3289,7 @@ class _DictOf(dict): self.pair_xml_element_name = pair_xml_element_name self.key_xml_element_name = key_xml_element_name self.value_xml_element_name = value_xml_element_name - super(_dict_of, self).__init__() + super(_DictOf, self).__init__() class AzureNodeLocation(NodeLocation):
