Skip to content

Commit

Permalink
Use device name from nova for attach message.
Browse files Browse the repository at this point in the history
Fixes bug #1042974.

Change-Id: I4db50f71c51cba45fd304c7847581609f646a0fb
  • Loading branch information
gabrielhurley committed Sep 7, 2012
1 parent eb21d51 commit 85b0bfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions horizon/api/nova.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,9 @@ def volume_delete(request, volume_id):


def volume_attach(request, volume_id, instance_id, device):
novaclient(request).volumes.create_server_volume(instance_id,
volume_id,
device)
return novaclient(request).volumes.create_server_volume(instance_id,
volume_id,
device)


def volume_detach(request, instance_id, att_id):
Expand Down
10 changes: 5 additions & 5 deletions horizon/dashboards/nova/volumes/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ def handle(self, request, data):
# it, so let's slice that off...
instance_name = instance_name.rsplit(" (")[0]
try:
api.volume_attach(request,
data['volume_id'],
data['instance'],
data.get('device', ''))
vol = api.volume_attach(request,
data['volume_id'],
data['instance'],
data.get('device', ''))
vol_name = api.volume_get(request, data['volume_id']).display_name

message = _('Attaching volume %(vol)s to instance '
'%(inst)s on %(dev)s.') % {"vol": vol_name,
"inst": instance_name,
"dev": data['device']}
"dev": vol.device}
messages.info(request, message)
return True
except:
Expand Down

0 comments on commit 85b0bfe

Please sign in to comment.