X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2FgenBundle.py;h=499cd63a85af730eb4873024c6c2ed47f7f7af29;hb=24ef44ef9b34bfc5d395226f547c0a3db685f43c;hp=8648ac3a9a1938c9de114e85a2d2d18eaff651fb;hpb=1e67ca426ab0f454fc2d4845efd5d9984782a4db;p=joid.git diff --git a/ci/genBundle.py b/ci/genBundle.py index 8648ac3a..499cd63a 100644 --- a/ci/genBundle.py +++ b/ci/genBundle.py @@ -34,7 +34,7 @@ labconfig_file = options.lab 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 @@ -88,7 +88,10 @@ def to_select(qty=False): 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): @@ -173,6 +176,8 @@ if 'bgpvpn' in features: 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: @@ -185,8 +190,8 @@ if 'trusty' 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 @@ -204,4 +209,13 @@ env.globals.update(unit_ceph_qty=unit_ceph_qty) 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)