]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Openstack: handle attached_volumes field when fetching volumes
authordeepssin <deepssin@redhat.com>
Thu, 25 Sep 2025 11:22:32 +0000 (07:22 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Mon, 12 Jan 2026 21:12:29 +0000 (16:12 -0500)
Some clouds use attached_volumes instead of os-extended-volumes:volumes_attached

Signed-off-by: deepssin <deepssin@redhat.com>
teuthology/openstack/__init__.py

index 54973cfd1d5d66d39934d09ec0263ea5b2ff2404..11d8ff150d7c67c8cc6f565a0019c7583385e632 100644 (file)
@@ -128,8 +128,12 @@ class OpenStackInstance(object):
         Return the uuid of the volumes attached to the name_or_id
         OpenStack instance.
         """
-        volumes = self['os-extended-volumes:volumes_attached']
-        return [volume['id'] for volume in volumes ]
+        info = self.info or {}
+        vols = (info.get('os-extended-volumes:volumes_attached')
+                or info.get('attached_volumes') 
+                or [])
+        volumes = [v['id'] for v in vols if isinstance(v, dict) and 'id' in v]
+        return volumes
 
     def get_addresses(self):
         """