Fixes passing boolean as string for symmetrical

Bug where 'True'/'False' strings were being passed in REST to Tacker
service which would end up throwing an exception because the DB type for
symmetrical is boolean/small int.  This converts it to boolean in the
client.

Closes-Bug: 1711550

Change-Id: Ide2aeab73b1dd88beb6e491e6b07cdee9fb7e48a
Signed-off-by: Tim Rozet <trozet@redhat.com>
This commit is contained in:
Tim Rozet 2017-08-18 16:22:23 -04:00
parent 1a749c310c
commit 9630f711a8
2 changed files with 7 additions and 4 deletions

View File

@ -97,7 +97,9 @@ class CreateVNFFG(tackerV10.CreateCommand):
help=_('List of logical VNFD name to VNF instance name mapping. '
'Example: VNF1:my_vnf1,VNF2:my_vnf2'))
parser.add_argument(
'--symmetrical', metavar='{True,False}',
'--symmetrical',
action='store_true',
default=False,
help=_('Should a reverse path be created for the NFP'))
parser.add_argument(
'--param-file',

View File

@ -44,9 +44,9 @@ class CLITestV10VmVNFFGJSON(test_cli10.CLITestV10Base):
vnffg_name,
'--vnffgd-id', vnffgd_id,
'--vnf-mapping', vnf_mapping,
'--symmetrical', 'True']
'--symmetrical']
position_names = ['vnffgd_id', 'vnf_mapping', 'symmetrical']
position_values = [vnffgd_id, {"VNFD1": "VNF1"}, 'True']
position_values = [vnffgd_id, {"VNFD1": "VNF1"}, True]
extra_body = {'name': vnffg_name, 'attributes': {}}
self._test_create_resource(self._RESOURCE, cmd, None, my_id,
args, position_names, position_values,
@ -64,7 +64,8 @@ class CLITestV10VmVNFFGJSON(test_cli10.CLITestV10Base):
]
position_names = ['vnffgd_id']
position_values = [vnffgd_id]
extra_body = {'name': vnffg_name, 'attributes': {}}
extra_body = {'symmetrical': False, 'name': vnffg_name,
'attributes': {}}
self._test_create_resource(self._RESOURCE, cmd, vnffg_name, my_id,
args, position_names, position_values,
extra_body=extra_body,