diff options
author | Narinder Gupta <narinder.gupta@canonical.com> | 2016-10-16 07:54:56 -0500 |
---|---|---|
committer | Narinder Gupta <narinder.gupta@canonical.com> | 2016-10-16 23:43:55 -0500 |
commit | f1dfc0776d32dea2a2fe7e2cb2b15b1836a6b666 (patch) | |
tree | b75bd8543a4ba5cc7919c43588b2522201c88c90 /ci/genBundle.py | |
parent | 498d228be6d2bb1f68b5d63813e01ecd68b315cd (diff) |
cmodfiied to add juju 2.0 support.
Change-Id: I3981f796cfb9ceb9f32522f4fed831d66e389c48
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci/genBundle.py')
-rw-r--r-- | ci/genBundle.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ci/genBundle.py b/ci/genBundle.py index 55f3f6eb..3eecdf4c 100644 --- a/ci/genBundle.py +++ b/ci/genBundle.py @@ -12,7 +12,9 @@ Parameters: 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 @@ -34,7 +36,12 @@ labconfig_file = options.lab 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 |