summaryrefslogtreecommitdiff
path: root/nova/volume/cinder.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/volume/cinder.py')
-rw-r--r--nova/volume/cinder.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/volume/cinder.py b/nova/volume/cinder.py
index 5a7c5aa106..e8748d1bc7 100644
--- a/nova/volume/cinder.py
+++ b/nova/volume/cinder.py
@@ -366,7 +366,8 @@ class API(object):
{'vol': volume_id,
'host': connector.get('host'),
'msg': six.text_type(exc),
- 'code': exc.code})
+ 'code': (
+ exc.code if hasattr(exc, 'code') else None)})
@translate_volume_exception
def terminate_connection(self, context, volume_id, connector):