summaryrefslogtreecommitdiff
path: root/nova/volume
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem.os@gmail.com>2017-05-25 21:35:09 -0400
committerSean Dague <sean@dague.net>2017-05-27 10:14:10 +0000
commit40cf447d28a5c9842f3546c4e7fe4efa682293cf (patch)
tree73a7019fb121a3d73d8cc79e49a7e506542dc76a /nova/volume
parent0cd67d23bd55a7b6cf273a94bcc4f62134a1dc93 (diff)
downloadnova-40cf447d28a5c9842f3546c4e7fe4efa682293cf.tar.gz
Avoid lazy-loading instance.id when cross_az_attach=False
The instance is no longer created in the API so the id attribute won't be set, which means when checking the instance AZ against the volume AZ, if they don't match we can't put the instance.id in the error message. We shouldn't have been putting the instance primary key in the error message anyway. This fixes the bug by using the instance.uuid which is set in this object in _provision_instances. Change-Id: I396b767815b666706fec980ded482fa4746d2efc Closes-Bug: #1693654
Diffstat (limited to 'nova/volume')
-rw-r--r--nova/volume/cinder.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/volume/cinder.py b/nova/volume/cinder.py
index c5469ed359..f49e8136cf 100644
--- a/nova/volume/cinder.py
+++ b/nova/volume/cinder.py
@@ -288,7 +288,7 @@ class API(object):
msg = _("Instance %(instance)s and volume %(vol)s are not in "
"the same availability_zone. Instance is in "
"%(ins_zone)s. Volume is in %(vol_zone)s") % {
- "instance": instance['id'],
+ "instance": instance.uuid,
"vol": volume['id'],
'ins_zone': instance_az,
'vol_zone': volume['availability_zone']}