should make Name tag only default if the user has not defined it in the cloud configuration file

This commit is contained in:
Paul Bruno 2018-07-23 17:17:10 -04:00
parent 61a74b68a4
commit bd22b9a9ac

View File

@ -2876,12 +2876,14 @@ def create(vm_=None, call=None):
for k, v in six.iteritems(ret['blockDeviceMapping']):
if isinstance(v, dict):
if v['deviceName'] in ex_blockdevicetags:
ex_blockdevicetags[v['deviceName']]['Name'] = vm_['name']
if not 'Name' in ex_blockdevicetags[v['deviceName']]:
ex_blockdevicetags[v['deviceName']]['Name'] = vm_['name']
block_device_volume_id_map[v[ret['rootDeviceType']]['volumeId']] = ex_blockdevicetags[v['deviceName']]
else:
for _d in v:
if _d['deviceName'] in ex_blockdevicetags:
ex_blockdevicetags[_d['deviceName']]['Name'] = vm_['name']
if not 'Name' in ex_blockdevicetags[_d['deviceName']]:
ex_blockdevicetags[_d['deviceName']]['Name'] = vm_['name']
block_device_volume_id_map[_d[ret['rootDeviceType']]['volumeId']] = ex_blockdevicetags[_d['deviceName']]
if block_device_volume_id_map: