from optparse import OptionParser
from jinja2 import Environment, FileSystemLoader
+from distutils.version import LooseVersion, StrictVersion
import os
+import subprocess
import random
import yaml
import sys
scenarioconfig_file = 'default_deployment_config.yaml'
# Capture our current directory
-TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/bundle_tpl'
+jujuver = subprocess.check_output(["juju", "--version"])
+
+if LooseVersion(jujuver) >= LooseVersion('2'):
+ TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/juju2/bundle_tpl'
+else:
+ TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/bundle_tpl'
#
# Prepare variables
else:
return 2
+def unit_scaleio_qty():
+ """Return size of the scaleio cluster"""
+ return 3
def to_select(qty=False):
"""Return a random list of machines numbers to deploy"""
config['ubuntu']['release'] = 'trusty'
if 'liberty' in extra:
config['os']['release'] = 'liberty'
+if 'xenial' in extra:
+ config['ubuntu']['release'] = 'xenial'
+ if 'newton' in extra:
+ config['os']['release'] = 'newton'
if 'dishypcon' in extra:
config['os']['hyperconverged'] = False
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(unit_scaleio_qty=unit_scaleio_qty)
env.globals.update(to_select=to_select)
# Render the template