Merge "parameter value wrongly mapped in vnfd"

This commit is contained in:
Jenkins 2017-01-06 02:48:03 +00:00 committed by Gerrit Code Review
commit 05fe0744c3
3 changed files with 14 additions and 10 deletions
tacker
tests/unit/vm/infra_drivers/openstack/data
vnfm/tosca

@ -10,7 +10,7 @@ outputs:
parameters: {}
resources:
CP1:
properties: {network: net-mgmt}
properties: {name: sriov, network: net-mgmt}
type: OS::Neutron::Port
CP2:
properties: {'binding:vnic_type': direct, network: sr3010}

@ -28,6 +28,7 @@ topology_template:
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
name: sriov
management: true
requirements:
- virtualLink:

@ -70,8 +70,8 @@ convert_prop = {TACKERCP: {'anti_spoofing_protection':
'type':
'binding:vnic_type'}}
convert_prop_values = {TACKERCP: {'sriov': 'direct',
'vnic': 'normal'}}
convert_prop_values = {TACKERCP: {'type': {'sriov': 'direct',
'vnic': 'normal'}}}
deletenodes = (MONITORING, FAILURE, PLACEMENT)
@ -239,6 +239,16 @@ def post_process_template(template):
if prop == p.name:
nt.get_properties_objects().remove(p)
# change the property value first before the property key
if nt.type in convert_prop_values:
for prop in convert_prop_values[nt.type].keys():
for p in nt.get_properties_objects():
if (prop == p.name and
p.value in
convert_prop_values[nt.type][prop].keys()):
v = convert_prop_values[nt.type][prop][p.value]
p.value = v
if nt.type in convert_prop:
for prop in convert_prop[nt.type].keys():
for p in nt.get_properties_objects():
@ -250,13 +260,6 @@ def post_process_template(template):
nt.get_properties_objects().append(newprop)
nt.get_properties_objects().remove(p)
if nt.type in convert_prop_values:
for key in convert_prop_values[nt.type].keys():
for p in nt.get_properties_objects():
if key == p.value:
v = convert_prop_values[nt.type][p.value]
p.value = v
@log.log
def get_mgmt_driver(template):