From 4fb57a9adc7e99684ec660b65a5ca49f6b231a99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 21:05:49 +0000 Subject: [PATCH 1/7] Bump paramiko from 3.3.1 to 3.4.0 Bumps [paramiko](https://github.com/paramiko/paramiko) from 3.3.1 to 3.4.0. - [Commits](https://github.com/paramiko/paramiko/compare/3.3.1...3.4.0) --- updated-dependencies: - dependency-name: paramiko dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements-lint.txt | 2 +- requirements-tests.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-lint.txt b/requirements-lint.txt index 5fff765540..f99bbdfb50 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -10,4 +10,4 @@ rstcheck==6.1.2; python_version >= '3.7' codespell==2.2.5 requests>=2.27.1 -paramiko==3.3.1; platform_python_implementation != 'PyPy' +paramiko==3.4.0; platform_python_implementation != 'PyPy' diff --git a/requirements-tests.txt b/requirements-tests.txt index 29655ab7a3..2847dad50b 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -12,5 +12,5 @@ pyopenssl==23.2.0 # Required by subset of tests fasteners -paramiko==3.3.1; platform_python_implementation != 'PyPy' +paramiko==3.4.0; platform_python_implementation != 'PyPy' libvirt-python==9.6.0 From f93d67f653cdf66e04f21cb9085e1c06e678a0f7 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 14 Apr 2024 21:32:50 +0200 Subject: [PATCH 2/7] Bump pyopenssl tests dependency. --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 2847dad50b..05ec62afb7 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -8,7 +8,7 @@ pytest-benchmark[histogram]==4.0.0 cryptography==41.0.6 # NOTE: Only needed by nttcis loadbalancer driver -pyopenssl==23.2.0 +pyopenssl==24.1.0 # Required by subset of tests fasteners From a16b6de5dd1967a80a07e9019ce009e7f27c14fb Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 14 Apr 2024 21:35:25 +0200 Subject: [PATCH 3/7] Upgrade black to v24.4.0. --- requirements-lint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-lint.txt b/requirements-lint.txt index f99bbdfb50..f53c45efc6 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -3,7 +3,7 @@ flake8==5.0.4 astroid==2.15.8; python_version >= '3.8' pylint==2.17.7; python_version >= '3.8' bandit[toml]==1.7.5; python_version >= '3.7' -black==23.9.1; python_version >= '3.7' and implementation_name == "cpython" +black==24.4.0; python_version >= '3.7' and implementation_name == "cpython" isort[pyproject]==5.12.0; python_version >= '3.8' pyupgrade==3.3.1 rstcheck==6.1.2; python_version >= '3.7' From e1bcd9cc3b5a14fc12a12cac991851b8b4b67bb9 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 14 Apr 2024 21:35:55 +0200 Subject: [PATCH 4/7] Reformat code with latest version of black. --- libcloud/common/exceptions.py | 1 - libcloud/common/openstack.py | 1 - libcloud/compute/drivers/azure.py | 5 -- libcloud/compute/drivers/dimensiondata.py | 70 ++++++++-------- libcloud/compute/drivers/ecs.py | 1 - libcloud/compute/drivers/equinixmetal.py | 6 +- libcloud/compute/drivers/nttcis.py | 82 ++++++++++--------- libcloud/compute/drivers/vcloud.py | 12 +-- .../loadbalancer/drivers/dimensiondata.py | 6 +- libcloud/loadbalancer/drivers/nttcis.py | 6 +- libcloud/test/compute/test_abiquo.py | 1 - libcloud/test/compute/test_azure_arm.py | 8 +- libcloud/test/compute/test_gandi.py | 2 - libcloud/test/compute/test_opennebula.py | 12 --- libcloud/test/compute/test_vcloud.py | 1 - libcloud/test/container/test_lxd.py | 1 - 16 files changed, 94 insertions(+), 121 deletions(-) diff --git a/libcloud/common/exceptions.py b/libcloud/common/exceptions.py index 12c4f96f99..6c6bcfa186 100644 --- a/libcloud/common/exceptions.py +++ b/libcloud/common/exceptions.py @@ -20,7 +20,6 @@ class BaseHTTPError(Exception): - """ The base exception class for all HTTP related exceptions. """ diff --git a/libcloud/common/openstack.py b/libcloud/common/openstack.py index 8f0702de3e..6c363316b6 100644 --- a/libcloud/common/openstack.py +++ b/libcloud/common/openstack.py @@ -57,7 +57,6 @@ class OpenStackBaseConnection(ConnectionUserAndKey): - """ Base class for OpenStack connections. diff --git a/libcloud/compute/drivers/azure.py b/libcloud/compute/drivers/azure.py index b5c29a18fa..d424f357d5 100644 --- a/libcloud/compute/drivers/azure.py +++ b/libcloud/compute/drivers/azure.py @@ -2577,7 +2577,6 @@ def extended_properties_dict_to_xml_fragment(extended_properties): class WindowsAzureData: - """ This is the base of data class. It is only used to check whether it is instance or not. @@ -2674,7 +2673,6 @@ def __init__(self): class CertificateSetting(WindowsAzureData): - """ Initializes a certificate setting. @@ -3141,7 +3139,6 @@ class _Base64String(str): class _ListOf(list): - """ A list which carries with it the type that's expected to go in it. Used for deserializaion and construction of the lists @@ -3157,7 +3154,6 @@ def __init__(self, list_type, xml_element_name=None): class ScalarListOf(list): - """ A list of scalar types which carries with it the type that's expected to go in it along with its xml element name. @@ -3171,7 +3167,6 @@ def __init__(self, list_type, xml_element_name): class _DictOf(dict): - """ A dict which carries with it the xml element names for key,val. Used for deserializaion and construction of the lists diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py index b06d59f85d..31660cec35 100644 --- a/libcloud/compute/drivers/dimensiondata.py +++ b/libcloud/compute/drivers/dimensiondata.py @@ -648,9 +648,9 @@ def create_node( ET.SubElement(additional_nic, "vlanId").text = vlan_id if nic.network_adapter_name is not None: - ET.SubElement( - additional_nic, "networkAdapter" - ).text = nic.network_adapter_name + ET.SubElement(additional_nic, "networkAdapter").text = ( + nic.network_adapter_name + ) elif ex_additional_nics is not None: raise TypeError("ex_additional_NICs must be None or tuple/list") @@ -955,9 +955,9 @@ def import_image( ET.SubElement(import_image_elem, "urn:datacenterId").text = datacenter_id if is_guest_os_customization is not None: - ET.SubElement( - import_image_elem, "urn:guestOsCustomization" - ).text = is_guest_os_customization + ET.SubElement(import_image_elem, "urn:guestOsCustomization").text = ( + is_guest_os_customization + ) if len(tagkey_name_value_dictionaries) > 0: for k, v in tagkey_name_value_dictionaries.items(): @@ -1847,9 +1847,9 @@ def ex_create_firewall_rule( positions_with_rule = ("BEFORE", "AFTER") create_node = ET.Element("createFirewallRule", {"xmlns": TYPES_URN}) - ET.SubElement( - create_node, "networkDomainId" - ).text = self._network_domain_to_network_domain_id(network_domain) + ET.SubElement(create_node, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(network_domain) + ) ET.SubElement(create_node, "name").text = rule.name ET.SubElement(create_node, "action").text = rule.action ET.SubElement(create_node, "ipVersion").text = rule.ip_version @@ -2514,9 +2514,9 @@ def ex_clone_node_to_image( ET.SubElement(clone_server_elem, "clusterId").text = cluster_id if is_guest_Os_Customization is not None: - ET.SubElement( - clone_server_elem, "guestOsCustomization" - ).text = is_guest_Os_Customization + ET.SubElement(clone_server_elem, "guestOsCustomization").text = ( + is_guest_Os_Customization + ) if tag_key_id is not None: tag_elem = ET.SubElement(clone_server_elem, "tagById") @@ -3179,9 +3179,9 @@ def ex_create_ip_address_list( ) create_ip_address_list = ET.Element("createIpAddressList", {"xmlns": TYPES_URN}) - ET.SubElement( - create_ip_address_list, "networkDomainId" - ).text = self._network_domain_to_network_domain_id(ex_network_domain) + ET.SubElement(create_ip_address_list, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(ex_network_domain) + ) ET.SubElement(create_ip_address_list, "name").text = name @@ -3203,9 +3203,9 @@ def ex_create_ip_address_list( ip_address.set("prefixSize", ip.prefix_size) if child_ip_address_list is not None: - ET.SubElement( - create_ip_address_list, "childIpAddressListId" - ).text = self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_list) + ET.SubElement(create_ip_address_list, "childIpAddressListId").text = ( + self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_list) + ) response = self.connection.request_with_orgId_api_2( "network/createIpAddressList", @@ -3301,9 +3301,9 @@ def ex_edit_ip_address_list( ip_address.set("prefixSize", ip.prefix_size) if child_ip_address_lists is not None: - ET.SubElement( - edit_ip_address_list, "childIpAddressListId" - ).text = self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_lists) + ET.SubElement(edit_ip_address_list, "childIpAddressListId").text = ( + self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_lists) + ) else: ET.SubElement(edit_ip_address_list, "childIpAddressListId", {"xsi:nil": "true"}) @@ -3499,9 +3499,9 @@ def ex_create_portlist( :rtype: ``bool`` """ new_port_list = ET.Element("createPortList", {"xmlns": TYPES_URN}) - ET.SubElement( - new_port_list, "networkDomainId" - ).text = self._network_domain_to_network_domain_id(ex_network_domain) + ET.SubElement(new_port_list, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(ex_network_domain) + ) ET.SubElement(new_port_list, "name").text = name @@ -3516,9 +3516,9 @@ def ex_create_portlist( if child_portlist_list is not None: for child in child_portlist_list: - ET.SubElement( - new_port_list, "childPortListId" - ).text = self._child_port_list_to_child_port_list_id(child) + ET.SubElement(new_port_list, "childPortListId").text = ( + self._child_port_list_to_child_port_list_id(child) + ) response = self.connection.request_with_orgId_api_2( "network/createPortList", method="POST", data=ET.tostring(new_port_list) @@ -3599,9 +3599,9 @@ def ex_edit_portlist(self, ex_portlist, description, port_collection, child_port if child_portlist_list is not None: for child in child_portlist_list: - ET.SubElement( - existing_port_address_list, "childPortListId" - ).text = self._child_port_list_to_child_port_list_id(child) + ET.SubElement(existing_port_address_list, "childPortListId").text = ( + self._child_port_list_to_child_port_list_id(child) + ) else: ET.SubElement(existing_port_address_list, "childPortListId", {"xsi:nil": "true"}) @@ -4367,11 +4367,11 @@ def _to_node(self, element): "description": findtext(element, "description", TYPES_URN), "sourceImageId": findtext(element, "sourceImageId", TYPES_URN), "networkId": findtext(element, "networkId", TYPES_URN), - "networkDomainId": element.find(fixxpath("networkInfo", TYPES_URN)).get( - "networkDomainId" - ) - if has_network_info - else None, + "networkDomainId": ( + element.find(fixxpath("networkInfo", TYPES_URN)).get("networkDomainId") + if has_network_info + else None + ), "datacenterId": element.get("datacenterId"), "deployedTime": findtext(element, "createTime", TYPES_URN), "cpu": cpu_spec, diff --git a/libcloud/compute/drivers/ecs.py b/libcloud/compute/drivers/ecs.py index a1bf742e74..fa437b9332 100644 --- a/libcloud/compute/drivers/ecs.py +++ b/libcloud/compute/drivers/ecs.py @@ -192,7 +192,6 @@ def __repr__(self): class ECSSecurityGroupAttribute: - """ Security group attribute. """ diff --git a/libcloud/compute/drivers/equinixmetal.py b/libcloud/compute/drivers/equinixmetal.py index 6d48fcada2..9458d256cf 100644 --- a/libcloud/compute/drivers/equinixmetal.py +++ b/libcloud/compute/drivers/equinixmetal.py @@ -89,9 +89,9 @@ def add_default_headers(self, headers): """ headers["Content-Type"] = "application/json" headers["X-Auth-Token"] = self.key - headers[ - "X-Consumer-Token" - ] = "kcrhMn7hwG8Ceo2hAhGFa2qpxLBvVHxEjS9ue8iqmsNkeeB2iQgMq4dNc1893pYu" + headers["X-Consumer-Token"] = ( + "kcrhMn7hwG8Ceo2hAhGFa2qpxLBvVHxEjS9ue8iqmsNkeeB2iQgMq4dNc1893pYu" + ) return headers diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py index 0c980cb82b..d90574afba 100644 --- a/libcloud/compute/drivers/nttcis.py +++ b/libcloud/compute/drivers/nttcis.py @@ -652,9 +652,9 @@ def create_node( ET.SubElement(additional_nic, "vlanId").text = vlan_id if nic.network_adapter_name is not None: - ET.SubElement( - additional_nic, "networkAdapter" - ).text = nic.network_adapter_name + ET.SubElement(additional_nic, "networkAdapter").text = ( + nic.network_adapter_name + ) elif ex_additional_nics is not None: raise TypeError("ex_additional_NICs must be None or tuple/list") @@ -1004,9 +1004,9 @@ def import_image( ET.SubElement(import_image_elem, "urn:datacenterId").text = datacenter_id if is_guest_os_customization is not None: - ET.SubElement( - import_image_elem, "urn:guestOsCustomization" - ).text = is_guest_os_customization + ET.SubElement(import_image_elem, "urn:guestOsCustomization").text = ( + is_guest_os_customization + ) if ( tagkey_name_value_dictionaries is not None @@ -2273,9 +2273,9 @@ def ex_create_firewall_rule( positions_with_rule = ("BEFORE", "AFTER") create_node = ET.Element("createFirewallRule", {"xmlns": TYPES_URN}) - ET.SubElement( - create_node, "networkDomainId" - ).text = self._network_domain_to_network_domain_id(network_domain) + ET.SubElement(create_node, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(network_domain) + ) ET.SubElement(create_node, "name").text = name ET.SubElement(create_node, "action").text = action ET.SubElement(create_node, "ipVersion").text = ip_version @@ -3032,9 +3032,9 @@ def ex_clone_node_to_image( ET.SubElement(clone_server_elem, "clusterId").text = cluster_id if is_guest_Os_Customization is not None: - ET.SubElement( - clone_server_elem, "guestOsCustomization" - ).text = is_guest_Os_Customization + ET.SubElement(clone_server_elem, "guestOsCustomization").text = ( + is_guest_Os_Customization + ) if tag_key_id is not None: tag_elem = ET.SubElement(clone_server_elem, "tagById") @@ -3724,9 +3724,9 @@ def ex_create_ip_address_list( ) create_ip_address_list = ET.Element("createIpAddressList", {"xmlns": TYPES_URN}) - ET.SubElement( - create_ip_address_list, "networkDomainId" - ).text = self._network_domain_to_network_domain_id(ex_network_domain) + ET.SubElement(create_ip_address_list, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(ex_network_domain) + ) ET.SubElement(create_ip_address_list, "name").text = name @@ -3748,9 +3748,9 @@ def ex_create_ip_address_list( ip_address.set("prefixSize", ip.prefix_size) if child_ip_address_list is not None: - ET.SubElement( - create_ip_address_list, "childIpAddressListId" - ).text = self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_list) + ET.SubElement(create_ip_address_list, "childIpAddressListId").text = ( + self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_list) + ) response = self.connection.request_with_orgId_api_2( "network/createIpAddressList", @@ -3851,9 +3851,9 @@ def ex_edit_ip_address_list( ip_address.set("prefixSize", ip.prefix_size) if child_ip_address_lists is not None: - ET.SubElement( - edit_ip_address_list, "childIpAddressListId" - ).text = self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_lists) + ET.SubElement(edit_ip_address_list, "childIpAddressListId").text = ( + self._child_ip_address_list_to_child_ip_address_list_id(child_ip_address_lists) + ) else: ET.SubElement(edit_ip_address_list, "childIpAddressListId", {"xsi:nil": "true"}) @@ -4051,9 +4051,9 @@ def ex_create_portlist( """ new_port_list = ET.Element("createPortList", {"xmlns": TYPES_URN}) - ET.SubElement( - new_port_list, "networkDomainId" - ).text = self._network_domain_to_network_domain_id(ex_network_domain) + ET.SubElement(new_port_list, "networkDomainId").text = ( + self._network_domain_to_network_domain_id(ex_network_domain) + ) ET.SubElement(new_port_list, "name").text = name @@ -4068,9 +4068,9 @@ def ex_create_portlist( if child_portlist_list is not None: for child in child_portlist_list: - ET.SubElement( - new_port_list, "childPortListId" - ).text = self._child_port_list_to_child_port_list_id(child) + ET.SubElement(new_port_list, "childPortListId").text = ( + self._child_port_list_to_child_port_list_id(child) + ) response = self.connection.request_with_orgId_api_2( "network/createPortList", method="POST", data=ET.tostring(new_port_list) @@ -4161,9 +4161,9 @@ def ex_edit_portlist( if child_portlist_list is not None: for child in child_portlist_list: - ET.SubElement( - existing_port_address_list, "childPortListId" - ).text = self._child_port_list_to_child_port_list_id(child) + ET.SubElement(existing_port_address_list, "childPortListId").text = ( + self._child_port_list_to_child_port_list_id(child) + ) else: ET.SubElement(existing_port_address_list, "childPortListId", {"xsi:nil": "true"}) @@ -5290,19 +5290,21 @@ def _to_node(self, element): "description": findtext(element, "description", TYPES_URN), "sourceImageId": findtext(element, "sourceImageId", TYPES_URN), "networkId": findtext(element, "networkId", TYPES_URN), - "networkDomainId": element.find(fixxpath("networkInfo", TYPES_URN)).get( - "networkDomainId" - ) - if has_network_info - else None, + "networkDomainId": ( + element.find(fixxpath("networkInfo", TYPES_URN)).get("networkDomainId") + if has_network_info + else None + ), "datacenterId": element.get("datacenterId"), "deployedTime": findtext(element, "createTime", TYPES_URN), "window": ( - element.find(fixxpath("snapshotService/window", TYPES_URN)).get("dayOfWeek"), - element.find(fixxpath("snapshotService/window", TYPES_URN)).get("startHour"), - ) - if has_snapshot - else None, + ( + element.find(fixxpath("snapshotService/window", TYPES_URN)).get("dayOfWeek"), + element.find(fixxpath("snapshotService/window", TYPES_URN)).get("startHour"), + ) + if has_snapshot + else None + ), "cpu": cpu_spec, "memoryMb": int(findtext(element, "memoryGb", TYPES_URN)) * 1024, "OS_id": operation_system.get("id"), diff --git a/libcloud/compute/drivers/vcloud.py b/libcloud/compute/drivers/vcloud.py index b3d885dc16..ad455cbe6b 100644 --- a/libcloud/compute/drivers/vcloud.py +++ b/libcloud/compute/drivers/vcloud.py @@ -450,7 +450,6 @@ def success(self): class VCloudConnection(ConnectionUserAndKey): - """ Connection class for the vCloud driver """ @@ -500,7 +499,6 @@ def add_default_headers(self, headers): class VCloudNodeDriver(NodeDriver): - """ vCloud node driver """ @@ -910,7 +908,6 @@ def create_node( class HostingComConnection(VCloudConnection): - """ vCloud connection subclass for Hosting.com """ @@ -926,7 +923,6 @@ def _get_auth_headers(self): class HostingComDriver(VCloudNodeDriver): - """ vCloud node driver for Hosting.com """ @@ -935,7 +931,6 @@ class HostingComDriver(VCloudNodeDriver): class TerremarkConnection(VCloudConnection): - """ vCloud connection subclass for Terremark """ @@ -944,7 +939,6 @@ class TerremarkConnection(VCloudConnection): class TerremarkDriver(VCloudNodeDriver): - """ vCloud node driver for Terremark """ @@ -1776,9 +1770,9 @@ def _clone_node(self, name, sourceNode, vdc, clone_timeout): "xmlns:ovf": "http://schemas.dmtf.org/ovf/envelope/1", }, ) - ET.SubElement( - network_xml, "ovf:Info" - ).text = "Specifies the available VM network connections" + ET.SubElement(network_xml, "ovf:Info").text = ( + "Specifies the available VM network connections" + ) headers = {"Content-Type": "application/vnd.vmware.vcloud.networkConnectionSection+xml"} res = self.connection.request( diff --git a/libcloud/loadbalancer/drivers/dimensiondata.py b/libcloud/loadbalancer/drivers/dimensiondata.py index 5f250ae068..997ffb4b9e 100644 --- a/libcloud/loadbalancer/drivers/dimensiondata.py +++ b/libcloud/loadbalancer/drivers/dimensiondata.py @@ -664,9 +664,9 @@ def ex_create_virtual_listener( if persistence_profile is not None: ET.SubElement(create_node_elm, "persistenceProfileId").text = persistence_profile.id if fallback_persistence_profile is not None: - ET.SubElement( - create_node_elm, "fallbackPersistenceProfileId" - ).text = fallback_persistence_profile.id + ET.SubElement(create_node_elm, "fallbackPersistenceProfileId").text = ( + fallback_persistence_profile.id + ) if irule is not None: ET.SubElement(create_node_elm, "iruleId").text = irule.id diff --git a/libcloud/loadbalancer/drivers/nttcis.py b/libcloud/loadbalancer/drivers/nttcis.py index 122726467d..f55d5d2002 100644 --- a/libcloud/loadbalancer/drivers/nttcis.py +++ b/libcloud/loadbalancer/drivers/nttcis.py @@ -736,9 +736,9 @@ def ex_create_virtual_listener( if optimization_profile is not None: ET.SubElement(create_node_elm, "optimizationProfile").text = optimization_profile if fallback_persistence_profile is not None: - ET.SubElement( - create_node_elm, "fallbackPersistenceProfileId" - ).text = fallback_persistence_profile.id + ET.SubElement(create_node_elm, "fallbackPersistenceProfileId").text = ( + fallback_persistence_profile.id + ) if irule is not None: ET.SubElement(create_node_elm, "iruleId").text = irule.id diff --git a/libcloud/test/compute/test_abiquo.py b/libcloud/test/compute/test_abiquo.py index 9e4a6ad0db..f3789ebd05 100644 --- a/libcloud/test/compute/test_abiquo.py +++ b/libcloud/test/compute/test_abiquo.py @@ -290,7 +290,6 @@ def test_get_href(self): class AbiquoMockHttp(MockHttp): - """ Mock the functionality of the remote Abiquo API. """ diff --git a/libcloud/test/compute/test_azure_arm.py b/libcloud/test/compute/test_azure_arm.py index 90d532900e..8efbc3c20a 100644 --- a/libcloud/test/compute/test_azure_arm.py +++ b/libcloud/test/compute/test_azure_arm.py @@ -393,9 +393,11 @@ def error(e, **kwargs): # 200 - NIC destroyed lambda f: (httplib.OK, None, {}, "OK"), # 200 - managed OS disk destroyed - lambda f: (httplib.OK, None, {}, "OK") - if response == 200 - else error(BaseHTTPError, code=response, message="Deleted or deferred"), + lambda f: ( + (httplib.OK, None, {}, "OK") + if response == 200 + else error(BaseHTTPError, code=response, message="Deleted or deferred") + ), ] ret = self.driver.destroy_node(node, ex_destroy_os_disk=True) self.assertTrue(ret) diff --git a/libcloud/test/compute/test_gandi.py b/libcloud/test/compute/test_gandi.py index 19b9832bb7..349838cfef 100644 --- a/libcloud/test/compute/test_gandi.py +++ b/libcloud/test/compute/test_gandi.py @@ -171,7 +171,6 @@ def test_ex_get_volume(self): class GandiRatingTests(unittest.TestCase): - """Tests where rating model is involved""" node_name = "test2" @@ -319,7 +318,6 @@ def _xmlrpc__hosting_ssh_delete(self, method, url, body, headers): class GandiMockRatingHttp(BaseGandiMockHttp): - """Fixtures needed for tests related to rating model""" fixtures = ComputeFileFixtures("gandi") diff --git a/libcloud/test/compute/test_opennebula.py b/libcloud/test/compute/test_opennebula.py index 47d9f999f2..9f23914030 100644 --- a/libcloud/test/compute/test_opennebula.py +++ b/libcloud/test/compute/test_opennebula.py @@ -42,7 +42,6 @@ class OpenNebula_1_4_Tests(unittest.TestCase): - """ OpenNebula.org test suite for OpenNebula v1.4. """ @@ -252,7 +251,6 @@ def test_ex_node_action(self): class OpenNebula_2_0_Tests(unittest.TestCase): - """ OpenNebula.org test suite for OpenNebula v2.0 through v2.2. """ @@ -537,7 +535,6 @@ def test_ex_list_networks(self): class OpenNebula_3_0_Tests(unittest.TestCase): - """ OpenNebula.org test suite for OpenNebula v3.0. """ @@ -580,7 +577,6 @@ def test_ex_node_set_save_name(self): class OpenNebula_3_2_Tests(unittest.TestCase): - """ OpenNebula.org test suite for OpenNebula v3.2. """ @@ -644,7 +640,6 @@ def test_list_sizes(self): class OpenNebula_3_6_Tests(unittest.TestCase): - """ OpenNebula.org test suite for OpenNebula v3.6. """ @@ -713,7 +708,6 @@ def test_list_volumes(self): class OpenNebula_3_8_Tests(unittest.TestCase): - """ OpenNebula.org test suite for OpenNebula v3.8. """ @@ -764,7 +758,6 @@ def test_list_sizes(self): class OpenNebula_1_4_MockHttp(MockHttp): - """ Mock HTTP server for testing v1.4 of the OpenNebula.org compute driver. """ @@ -905,7 +898,6 @@ def _network_15(self, method, url, body, headers): class OpenNebula_2_0_MockHttp(MockHttp): - """ Mock HTTP server for testing v2.0 through v3.2 of the OpenNebula.org compute driver. @@ -1047,7 +1039,6 @@ def _network_15(self, method, url, body, headers): class OpenNebula_3_0_MockHttp(OpenNebula_2_0_MockHttp): - """ Mock HTTP server for testing v3.0 of the OpenNebula.org compute driver. """ @@ -1092,7 +1083,6 @@ def _network_15(self, method, url, body, headers): class OpenNebula_3_2_MockHttp(OpenNebula_3_0_MockHttp): - """ Mock HTTP server for testing v3.2 of the OpenNebula.org compute driver. """ @@ -1125,7 +1115,6 @@ def _instance_type(self, method, url, body, headers): class OpenNebula_3_6_MockHttp(OpenNebula_3_2_MockHttp): - """ Mock HTTP server for testing v3.6 of the OpenNebula.org compute driver. """ @@ -1193,7 +1182,6 @@ def _storage_15(self, method, url, body, headers): class OpenNebula_3_8_MockHttp(OpenNebula_3_2_MockHttp): - """ Mock HTTP server for testing v3.8 of the OpenNebula.org compute driver. """ diff --git a/libcloud/test/compute/test_vcloud.py b/libcloud/test/compute/test_vcloud.py index 981f788bf5..9053074cac 100644 --- a/libcloud/test/compute/test_vcloud.py +++ b/libcloud/test/compute/test_vcloud.py @@ -1060,7 +1060,6 @@ def _api_v0_8_task_11001(self, method, url, body, headers): class AnotherErrorMember(Exception): - """ helper class for the synthetic exception """ diff --git a/libcloud/test/container/test_lxd.py b/libcloud/test/container/test_lxd.py index a9a437c5b1..732bfd6753 100644 --- a/libcloud/test/container/test_lxd.py +++ b/libcloud/test/container/test_lxd.py @@ -29,7 +29,6 @@ class LXDContainerDriverTestCase(unittest.TestCase): - """ Unit tests for LXDContainerDriver """ From b2bcef0772457569aa340071726e1f0b1963c241 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 14 Apr 2024 21:37:47 +0200 Subject: [PATCH 5/7] Fix black config - use correct config key name. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8887c0950b..e93fc21b94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,7 +104,7 @@ universal = true line_length = 100 target_version = ['py37', 'py38', 'py39', 'py310', 'py311'] include = '\.pyi?$' -extended_exclude = ''' +exclude = ''' ( /( | \.git From 4f3169f4f5e06de18df4ff3f3bdfc08d3907f7a2 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 14 Apr 2024 21:38:14 +0200 Subject: [PATCH 6/7] Upgrade cryptography tests dependency to v42.0.5 --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 05ec62afb7..0dfaa7e58d 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -5,7 +5,7 @@ pytest==7.4.0 pytest-xdist==3.3.1 pytest-timeout==2.2.0 pytest-benchmark[histogram]==4.0.0 -cryptography==41.0.6 +cryptography==42.0.5 # NOTE: Only needed by nttcis loadbalancer driver pyopenssl==24.1.0 From 637c2acd7d2b0e6eb6d1d32ce6447e7b9eccddb4 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 14 Apr 2024 21:40:20 +0200 Subject: [PATCH 7/7] Update black config so it doesn't try to format secrets.py file which is not checked into repository. --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e93fc21b94..1fc638f468 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,6 +110,7 @@ exclude = ''' | \.git | \.virtualenv | __pycache__ + | secrets\.py )/ ) '''