summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sfc/lib/topology_shuffler.py2
-rw-r--r--sfc/lib/utils.py18
2 files changed, 15 insertions, 5 deletions
diff --git a/sfc/lib/topology_shuffler.py b/sfc/lib/topology_shuffler.py
index ccabe427..bfa86420 100644
--- a/sfc/lib/topology_shuffler.py
+++ b/sfc/lib/topology_shuffler.py
@@ -60,7 +60,7 @@ def _get_seed():
NOTE: There's sure a smarter way to do this
Probably with the Jenkins job id
'''
- cutoff = len(TOPOLOGIES - 1)
+ cutoff = len(TOPOLOGIES) - 1
seed = datetime.datetime.today().weekday()
if seed > cutoff:
seed = random.randrange(cutoff)
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,