diff --git a/libcloud/compute/drivers/azure.py b/libcloud/compute/drivers/azure.py index 35cc0917ba..a9b249eeee 100644 --- a/libcloud/compute/drivers/azure.py +++ b/libcloud/compute/drivers/azure.py @@ -1709,7 +1709,8 @@ def _convert_class_to_xml(self, source, xml_prefix=True): root = ET.Element() doc = self._construct_element_tree(source, root) - result = ensure_string(ET.tostring(doc, encoding='utf8', method='xml')) + result = ensure_string(ET.tostring(doc, encoding='utf-8', + method='xml')) return result def _construct_element_tree(self, source, etree): @@ -2108,7 +2109,7 @@ def restart_role_operation_to_xml(): 'RestartRoleOperation', xml ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding='utf-8')) return result @staticmethod @@ -2119,7 +2120,7 @@ def shutdown_role_operation_to_xml(): 'ShutdownRoleOperation', xml ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding='utf-8')) return result @staticmethod @@ -2130,7 +2131,7 @@ def start_role_operation_to_xml(): 'StartRoleOperation', xml ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding='utf-8')) return result @staticmethod @@ -2520,7 +2521,7 @@ def add_role_to_xml(role_name, system_configuration_set, doc ) - result = ensure_string(ET.tostring(xml, encoding='utf8')) + result = ensure_string(ET.tostring(xml, encoding='utf-8')) return result @staticmethod @@ -2547,7 +2548,7 @@ def update_role_to_xml(role_name, doc ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding='utf-8')) return result @staticmethod @@ -2587,7 +2588,7 @@ def capture_role_to_xml(post_capture_action, xml ) doc = AzureXmlSerializer.doc_from_xml('CaptureRoleOperation', xml) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding='utf-8')) return result @staticmethod @@ -2638,7 +2639,7 @@ def virtual_machine_deployment_to_xml(deployment_name, ) ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding='utf-8')) return result @staticmethod @@ -2707,7 +2708,7 @@ def doc_from_data(document_element_name, data, extended_properties=None): ) ) - result = ensure_string(ET.tostring(doc, encoding='utf8')) + result = ensure_string(ET.tostring(doc, encoding='utf-8')) return result @staticmethod