summaryrefslogtreecommitdiff
path: root/cinder/compute/nova.py
diff options
context:
space:
mode:
Diffstat (limited to 'cinder/compute/nova.py')
-rw-r--r--cinder/compute/nova.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cinder/compute/nova.py b/cinder/compute/nova.py
index b0a0952ff..3e87009cd 100644
--- a/cinder/compute/nova.py
+++ b/cinder/compute/nova.py
@@ -133,6 +133,7 @@ def novaclient(context, privileged_user=False, timeout=None, api_version=None):
class API(base.Base):
"""API for interacting with novaclient."""
+ NotFound = nova_exceptions.NotFound
def __init__(self):
self.message_api = message_api.API()
@@ -237,3 +238,9 @@ class API(base.Base):
resource_uuid=volume_id,
detail=message_field.Detail.REIMAGE_VOLUME_FAILED)
return result
+
+ @staticmethod
+ def get_server_volume(context, server_id, volume_id):
+ # Use microversion that includes attachment_id
+ nova = novaclient(context, api_version='2.89')
+ return nova.volumes.get_server_volume(server_id, volume_id)