From 431f5605eb7d27b3067d459e8498b7150d6cc5f3 Mon Sep 17 00:00:00 2001 From: Rich Hagarty Date: Thu, 10 Sep 2015 15:24:13 -0700 Subject: [PATCH] Unable to attach volume to instance Nova api no longer allows blank device names when attaching a volume. In this case, the value needs to be set to None. Closes-Bug: #1492450 Change-Id: Iae4d79ddd9c102782e27e0b641fb07167d3da63c --- .../dashboards/project/volumes/volumes/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/project/volumes/volumes/forms.py b/openstack_dashboard/dashboards/project/volumes/volumes/forms.py index 9e56fe40ec..022941bae2 100644 --- a/openstack_dashboard/dashboards/project/volumes/volumes/forms.py +++ b/openstack_dashboard/dashboards/project/volumes/volumes/forms.py @@ -469,11 +469,15 @@ class AttachForm(forms.SelfHandlingForm): # The name of the instance in the choices list has the ID appended to # it, so let's slice that off... instance_name = instance_name.rsplit(" (")[0] + + # api requires non-empty device name or None + device = data.get('device') or None + try: attach = api.nova.instance_volume_attach(request, data['volume_id'], data['instance'], - data.get('device', '')) + device) volume = cinder.volume_get(request, data['volume_id']) message = _('Attaching volume %(vol)s to instance ' '%(inst)s on %(dev)s.') % {"vol": volume.name,