From f1dfc0776d32dea2a2fe7e2cb2b15b1836a6b666 Mon Sep 17 00:00:00 2001 From: Narinder Gupta Date: Sun, 16 Oct 2016 07:54:56 -0500 Subject: cmodfiied to add juju 2.0 support. Change-Id: I3981f796cfb9ceb9f32522f4fed831d66e389c48 Signed-off-by: Narinder Gupta --- ci/genBundle.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ci/genBundle.py') 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 -- cgit 1.2.3-korg