[sdk] renaming a volume with the SDK

jdratlif at globalnoc.iu.edu jdratlif at globalnoc.iu.edu
Fri Jun 24 18:13:30 UTC 2022

from keystoneauth1.adapter import Adapter

adapter = Adapter(conn.session, service_type="block-storage")


Adding this and passing adapter instead of conn.session to the commit call
seems to work.



John Ratliff

Systems Automation Engineer 

GlobalNOC @ Indiana University


From: jdratlif at globalnoc.iu.edu <jdratlif at globalnoc.iu.edu> 
Sent: Friday, June 24, 2022 11:44 AM
To: openstack-discuss at lists.openstack.org
Cc: Ratliff, John <jdratlif at iu.edu>
Subject: [sdk] renaming a volume with the SDK


I'm trying to set a property on a volume, specifically the name. But when I
try to do this, it tells me the Session object has no default_microversion.
I have all my auth in environment variables. Using TOKEN authentication.


What am I doing wrong here?


import openstack

from openstack.block_storage.v3._proxy import Proxy as BlockStorageService

from openstack.block_storage.v3.volume import Volume


# enable openstack debug logging



conn = openstack.connect()


cinder: BlockStorageService = conn.block_storage

volume: Volume = cinder.get_volume("b3a70014-1cf0-4fd1-bdc4-183dbfd33e79")

volume.name = "test_rename"







John Ratliff

Systems Automation Engineer 

GlobalNOC @ Indiana University


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20220624/104b689e/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6687 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20220624/104b689e/attachment-0001.bin>

More information about the openstack-discuss mailing list