From 2eb5c0d601f5aaa004822cd38db486600ebe9473 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 17:42:38 +0000 Subject: [PATCH 1/2] Bump pyupgrade from 3.3.1 to 3.21.2 Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 3.3.1 to 3.21.2. - [Commits](https://github.com/asottile/pyupgrade/compare/v3.3.1...v3.21.2) --- updated-dependencies: - dependency-name: pyupgrade dependency-version: 3.21.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ee5cf0fbf1..0bb066a004 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,7 +102,7 @@ lint = [ "bandit[toml]==1.9.3; python_version >= '3.10'", "black==26.3.1; python_version >= '3.10' and implementation_name == \"cpython\"", "isort==6.0.1; python_version >= '3.10'", - "pyupgrade==3.3.1", + "pyupgrade==3.21.2", "rstcheck==6.2.5; python_version >= '3.10'", "codespell==2.4.1", "prek>=0.2.17", From ad63e3be59cdb2ad3d50af54707c13daa791db5d Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Fri, 6 Nov 2026 14:02:15 +0100 Subject: [PATCH 2/2] Fix code in drivers --- libcloud/compute/drivers/dimensiondata.py | 16 ++-------------- libcloud/compute/drivers/nttcis.py | 15 ++------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py index 31660cec35..fea9abf609 100644 --- a/libcloud/compute/drivers/dimensiondata.py +++ b/libcloud/compute/drivers/dimensiondata.py @@ -16,8 +16,6 @@ Dimension Data Driver """ -import sys - from libcloud.utils.py3 import ET, urlencode, basestring, ensure_string from libcloud.utils.xml import findall, findtext, fixxpath from libcloud.compute.base import ( @@ -3938,12 +3936,7 @@ def ex_create_node_uncustomized( if not isinstance(ex_tagid_value_pairs, dict): raise ValueError("ex_tagid_value_pairs must be a dictionary.") - if sys.version_info[0] < 3: - tagid_items = ex_tagid_value_pairs.iteritems() - else: - tagid_items = ex_tagid_value_pairs.items() - - for k, v in tagid_items: + for k, v in ex_tagid_value_pairs.items(): tag_elem = ET.SubElement(server_uncustomized_elm, "tagById") ET.SubElement(tag_elem, "tagKeyId").text = k @@ -3954,12 +3947,7 @@ def ex_create_node_uncustomized( if not isinstance(ex_tagname_value_pairs, dict): raise ValueError("ex_tagname_value_pairs must be a dictionary") - if sys.version_info[0] < 3: - tags_items = ex_tagname_value_pairs.iteritems() - else: - tags_items = ex_tagname_value_pairs.items() - - for k, v in tags_items: + for k, v in ex_tagname_value_pairs.items(): tag_name_elem = ET.SubElement(server_uncustomized_elm, "tag") ET.SubElement(tag_name_elem, "tagKeyName").text = k diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py index 468cfd1607..32ca50fcdc 100644 --- a/libcloud/compute/drivers/nttcis.py +++ b/libcloud/compute/drivers/nttcis.py @@ -17,7 +17,6 @@ """ import re -import sys from libcloud.utils.py3 import ET, urlencode, basestring, ensure_string from libcloud.utils.xml import findall, findtext, fixxpath @@ -4730,12 +4729,7 @@ def ex_create_node_uncustomized( if not isinstance(ex_tagid_value_pairs, dict): raise ValueError("ex_tagid_value_pairs must be a dictionary.") - if sys.version_info[0] < 3: - tagid_items = ex_tagid_value_pairs.iteritems() - else: - tagid_items = ex_tagid_value_pairs.items() - - for k, v in tagid_items: + for k, v in ex_tagid_value_pairs.items(): tag_elem = ET.SubElement(server_uncustomized_elm, "tagById") ET.SubElement(tag_elem, "tagKeyId").text = k @@ -4746,12 +4740,7 @@ def ex_create_node_uncustomized( if not isinstance(ex_tagname_value_pairs, dict): raise ValueError("ex_tagname_value_pairs must be a dictionary") - if sys.version_info[0] < 3: - tags_items = ex_tagname_value_pairs.iteritems() - else: - tags_items = ex_tagname_value_pairs.items() - - for k, v in tags_items: + for k, v in ex_tagname_value_pairs.items(): tag_name_elem = ET.SubElement(server_uncustomized_elm, "tag") ET.SubElement(tag_name_elem, "tagKeyName").text = k