diff options
author | George Paraskevopoulos <geopar@intracom-telecom.com> | 2017-02-17 14:58:01 +0200 |
---|---|---|
committer | George Paraskevopoulos <geopar@intracom-telecom.com> | 2017-02-17 14:58:01 +0200 |
commit | b1e66426c1efe2f7412a417eb3b728d5a8026e65 (patch) | |
tree | 2ebbcef6e18dda7fa255bd365ec04d53fea4d08e /sfc/lib/utils.py | |
parent | 48600f556970a7a4f7ea9194fccc0ff1dc077ca8 (diff) |
Fix topology bugs
- Fix getting the length of available topologies
- Format a correct vnf parameter file
Change-Id: I6c3534a67b44be6fcfb09d99856e5c27bcbd2ed1
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
Diffstat (limited to 'sfc/lib/utils.py')
-rw-r--r-- | sfc/lib/utils.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py index d3b2c063..60f6776a 100644 --- a/sfc/lib/utils.py +++ b/sfc/lib/utils.py @@ -83,10 +83,20 @@ def create_vnf_in_av_zone(tacker_client, vnf_name, vnfd_name, av_zone=None): 'vnfd-templates', 'test-vnfd-default-params.yaml') if av_zone is not None: - param_file = os.path.join('/tmp', 'param_{0}.yaml'.format(av_zone)) - data = {'zone': av_zone} - with open(param_file) as f: - yaml.dump(data, f) + param_file = os.path.join( + '/tmp', + 'param_{0}.yaml'.format(av_zone.replace('::', '_'))) + data = { + 'vdus': { + 'vdu1': { + 'param': { + 'zone': av_zone + } + } + } + } + with open(param_file, 'w+') as f: + yaml.dump(data, f, default_flow_style=False) os_tacker.create_vnf(tacker_client, vnf_name, |