Merge "Name and description are always copied from template"

This commit is contained in:
Jenkins 2015-07-28 09:39:35 +00:00 committed by Gerrit Code Review
commit 30f3d39d38

View File

@ -86,10 +86,14 @@ class DeviceHeat(abstract_driver.DeviceAbstractDriver):
vnfd_dict = yaml.load(vnfd_yaml)
KEY_LIST = (('name', 'template_name'), ('description', 'description'))
device_template_dict.update(
dict((key, vnfd_dict[vnfd_key]) for (key, vnfd_key) in KEY_LIST
if (not key in device_template_dict.get(key) and
vnfd_key in vnfd_dict)))
if ((not key in device_template_dict or
device_template_dict[key] == '') and
vnfd_key in vnfd_dict and
vnfd_dict[vnfd_key] != '')))
service_types = vnfd_dict.get('service_properties', {}).get('type', [])
if service_types:
device_template_dict.setdefault('service_types', []).extend(