Skip to content

Conversation

@raineszm
Copy link
Contributor

The old python clients are deprecated and the openstacksdk code is a bit easier to read. Functionality should not be affected.

@raineszm raineszm marked this pull request as draft December 12, 2025 21:13
The old python clients are deprecated and the openstacksdk
code is a bit easier to read. Functionality should not be affected.

Signed-off-by: Zachary Raines <[email protected]>
@raineszm raineszm force-pushed the refactor/use-openstacksdk branch from c45da5e to 0e6853d Compare December 12, 2025 23:01
@raineszm
Copy link
Contributor Author

Tested with a fresh jammy-caracal stsstack bundles deployment.

@raineszm raineszm marked this pull request as ready for review December 12, 2025 23:20
Copy link
Collaborator

@brianphaley brianphaley left a comment

Choose a reason for hiding this comment

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

Just some nits but otherwise Ok. Changing to use the SDK was on my list for next year, as is some cleanup of calls using the openstackclient, but this is a good start.

So are the non -ksv3 files never used? Or post-deploy-config ?

BTW, there has been a similar multi-year push upstream as we want to retire neutronclient eventually, https://review.opendev.org/q/topic:%22bug/1999774%22

'network_id': network['id'],
'enable_dhcp': False,
'ip_version': 4,
'tenant_id': project_id
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the project_id key work here? We've been moving away from tenant_id upstream for a while when possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

project_id isn't a named kwarg but I can test if it works since it seems it's passed along to the Subnet message. Maybe worth a PR in openstacksdk.

name=subnet_name,
cidr=cidr,
ip_version=4,
tenant_id=project_id,
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/project_id if possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://docs.openstack.org/openstacksdk/latest/user/connection.html#openstack.connection.Connection.create_subnet From my reading project_id isn't a supported keyword here, but I haven't actually looked at the code of the method.

project_id = auth.get_project_id(sess)
project_id = conn.current_project_id
if not project_id:
logging.error("Unable to locate project id for %s.", opts.tenant)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll send a follow-on adding opts.project (-p) once this merges

@raineszm
Copy link
Contributor Author

Just some nits but otherwise Ok. Changing to use the SDK was on my list for next year, as is some cleanup of calls using the openstackclient, but this is a good start.

So are the non -ksv3 files never used? Or post-deploy-config ?

BTW, there has been a similar multi-year push upstream as we want to retire neutronclient eventually, https://review.opendev.org/q/topic:%22bug/1999774%22

Does openstacksdk work with keystone v2? If so we can probably unify the scripts.

While the signature of create_subnet doesn't
explicitly accept project_id, it correctly
passes it along to the API nonetheless.

Signed-off-by: Zachary Raines <[email protected]>
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