Add some additional server meta munging

This commit is contained in:
Monty Taylor 2014-10-25 18:52:05 -07:00
parent 313fb397d5
commit 9c540a224d
1 changed files with 7 additions and 2 deletions

View File

@ -103,8 +103,13 @@ def get_hostvars_from_server(cloud, server, mounts=None):
if image_name:
server_vars['image']['name'] = image_name
server_vars['volumes'] = [
obj_to_dict(f) for f in cloud.get_volumes(server)]
volumes = []
for vol in cloud.get_volumes(server):
volume = obj_to_dict(vol)
# Make things easier to consume elsewhere
volume['device'] = volume['attachments'][0]['device']
volumes.append(volume)
server_vars['volumes'] = volumes
if mounts:
for mount in mounts:
for vol in server_vars['volumes']: