scenarioconfig_file = 'default_deployment_config.yaml'
# Capture our current directory
-TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/bundle_tpl'
+TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/bundle_tpl'
#
# Prepare variables
if not qty:
qty = config['os']['ha']['cluster_size'] if \
config['os']['ha']['mode'] == 'ha' else 1
- return random.sample(range(0, config['opnfv']['units']), qty)
+ if config['os']['hyperconverged']:
+ return random.sample(range(0, config['opnfv']['units']), qty)
+ else:
+ return random.sample(range(0, qty), qty)
def get_password(key, length=16, special=False):
config['os']['network']['bgpvpn'] = True
if 'odll3' in features:
config['os']['network']['odll3'] = True
+if 'dishypcon' in features:
+ config['os']['hyperconverged'] = False
# Set beta option from extra
if 'publicapi' in extra:
config['ubuntu']['release'] = 'trusty'
if 'liberty' in extra:
config['os']['release'] = 'liberty'
-
-# pp(config)
+if 'dishypcon' in extra:
+ config['os']['hyperconverged'] = False
#
# Transform template to bundle.yaml according to config
env.globals.update(to_select=to_select)
# Render the template
-print(template.render(**config))
+output = template.render(**config)
+
+# Check output syntax
+try:
+ yaml.load(output)
+except yaml.YAMLError as exc:
+ print(exc)
+
+# print output
+print(output)