Skip to content

feat: upgrade openstacksdk - #508

Open
rpocase wants to merge 2 commits into
canonical:mainfrom
rpocase:20260626-upgrade-openstack-sdk
Open

feat: upgrade openstacksdk#508
rpocase wants to merge 2 commits into
canonical:mainfrom
rpocase:20260626-upgrade-openstack-sdk

Conversation

@rpocase

@rpocase rpocase commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

PR Checklist

To ease the process of reviewing your PR, do make sure to complete the following checklist before submitting a pull
request.

  • I have added unit tests to cover the new behavior under ``tests/unit_tests/```
  • I have run tox -e format locally to automatically format my code before submitting
  • I have run tox locally ensuring that it passes before submitting
  • [-] (if applicable) I have added a reference to issues that this PR relates to in the PR message (Refs GH-1234, Fixes GH-1234)
  • My commits are atomic and follow the convetional commit message format (https://www.conventionalcommits.org/en/v1.0.0/)

Description

this migrates openstacksdk to a modern modern version. the intention is
to drop netiface from the dependency tree because the package is no
longer maintained

this also drops python 3.8, 3.9 support. this started as a means to get to an openstack version that
did not include netiface as a dependency. after that, i noticed python 3.8 + 3.9 went EOL and are not tested in CI. to get to a version of openstacksdk without inetface it required dropping 3.8, 3.9.

Additional Context and Relevant Issues

this builds off of #507

Test Steps

N/A

@rpocase rpocase changed the title 20260626 upgrade openstack sdk feat: upgrade openstack sdk Jun 26, 2026
@rpocase rpocase changed the title feat: upgrade openstack sdk feat: upgrade openstacksdk Jun 26, 2026
@rpocase
rpocase force-pushed the 20260626-upgrade-openstack-sdk branch from 2e88902 to d9b641d Compare July 24, 2026 20:03
rpocase added 2 commits July 24, 2026 15:05
Require Python >= 3.10, remove py3.8/3.9 classifiers and the py38
tox environment, and bump the package version accordingly.

Python 3.8 support ended on October 7th, 2024 and is not being tested in CI.
Python 3.9 support ended on October 31th, 2025 and is not being tested in CI.
Bump openstacksdk to >= 4.2.0, < 4.9.0 and cap
python-openstackclient at < 8.3.0, updating the lockfile
accordingly. The intention is to drop netiface from the dependency
tree because the package is no longer maintained

@blackboxsw blackboxsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @rpocase cloud-init is +1 on the breaking change w/ floor of python support at 3.10 for all our test harnesses. With the bump in openstacksdk, I'd like to see us also adapt to the new Compute, Network connection objects to insulate pycloudlib from future SDK changes and eventual deprecation of legacy top-level conn methods.

Comment thread pyproject.toml
"knack >= 0.7.1",
"oci >= 2.17.0",
"openstacksdk >= 1.1.0, < 1.5.0",
"openstacksdk >= 4.2.0, < 4.9.0",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a huge bump in openstackSDK, can we provide a separate commit to all self.conn changes to align with latest openstacksdk API changes?

It looks to me like we'd expect to see methods hung off of separate self.conn.compute, self.conn.network or self.conn.image. For example, instead of top-level self.conn.create_floating_ip we should be able to use the self.conn.network.create_ip method.

@blackboxsw blackboxsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this changeset may break openstacksdk as APIs have changed to Connection-based objects conn.network conn.compute etc.

Can we get a validation that the following works when you have a sourced valid .novarc?

openstack image list # determine the ID  your want to launch
IMAGE_ID=<IMAGE_ID>
tox -e pytest
source .tox/.testenv/bin/activate
python3 ./examples/openstack_example.py $IMAGE_ID

NOTE: I ran into issues that openstack doesn't like the keyname pycloudlib comes up with , which is our corparate-laptop username. I think we may need to replace any @ and . with hyphens before trying to upload keys to openstack from pycloudlib.

NOTE: I also had to add a specific instance_type to examples to align with my current openstack instance I had access too. From: openstack flavor list

diff --git a/examples/openstack_example.py b/examples/openstack_example.py
index fe8657e..4458d18 100644
--- a/examples/openstack_example.py
+++ b/examples/openstack_example.py
@@ -14,7 +14,7 @@ REQUIRED_ENV_VARS = ("OS_AUTH_URL", "OS_PASSWORD", "OS_USERNAME")
 def basic_lifecycle(image_id: str):
     """Demonstrate basic set of lifecycle operations with OpenStack."""
     with pycloudlib.Openstack("pycloudlib-test") as os_cloud:
-        with os_cloud.launch(image_id=image_id) as inst:
+        with os_cloud.launch(instance_type="production-cpu2-ram4-disk20", image_id=image_id) as inst:
             inst.wait()

Comment thread tox.ini
[testenv:py38]
envdir = {[common]envdir}
deps = {[common]deps}
basepython = python3.8

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we retain an explicit [testenv:python10] in tox.ini instead of just removing testenv:py38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants