summaryrefslogtreecommitdiffstats
path: root/ci/genBundle.py
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2016-07-01 13:35:25 -0500
committerNarinder Gupta <narinder.gupta@canonical.com>2016-07-01 14:15:44 -0500
commit87ff38481a31846f3171976fbb039d5d3e10929a (patch)
treeb1dea2757cc9a9362ef23ac9cf8cadbe0613658d /ci/genBundle.py
parent628346cfd690524f1ec455ca35c3bc7474640079 (diff)
modified for nonha bundles now.
Change-Id: Ic29910c9e95718603588da9fd2664ed933a88b7a Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci/genBundle.py')
-rw-r--r--ci/genBundle.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/ci/genBundle.py b/ci/genBundle.py
index cb61f5aa..89f41ce6 100644
--- a/ci/genBundle.py
+++ b/ci/genBundle.py
@@ -57,11 +57,21 @@ def unit_qty():
else:
return 1
+def unit_ceph_qty():
+ global config
+ if config['os']['ha']['mode'] == 'ha':
+ return config['os']['ha']['cluster_size']
+ else:
+ return 2
+
def to_select( qty = False ):
global config
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']['ha']['mode'] == 'ha':
+ return random.sample(range(0,config['opnfv']['units']), qty )
+ else:
+ return random.sample(range(0,2),qty )
def get_password(key, length=16, special=False):
global passwords_store
@@ -159,6 +169,7 @@ template = env.get_template('bundle.yaml')
# Add functions
env.globals.update(get_password=get_password)
env.globals.update(unit_qty=unit_qty)
+env.globals.update(unit_ceph_qty=unit_ceph_qty)
env.globals.update(to_select=to_select)
# Render the template