summaryrefslogtreecommitdiffstats
path: root/ci/genMAASConfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'ci/genMAASConfig.py')
-rw-r--r--ci/genMAASConfig.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/ci/genMAASConfig.py b/ci/genMAASConfig.py
index 2b4948dc..c3bc92f0 100644
--- a/ci/genMAASConfig.py
+++ b/ci/genMAASConfig.py
@@ -10,7 +10,9 @@ Parameters:
from optparse import OptionParser
from jinja2 import Environment, FileSystemLoader
+from distutils.version import LooseVersion, StrictVersion
import os
+import subprocess
import yaml
from pprint import pprint as pp
import socket
@@ -31,7 +33,13 @@ labconfig_file = options.lab
#
# Capture our current directory
-TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/maas_tpl'
+jujuver = subprocess.check_output(["juju", "--version"])
+
+if LooseVersion(jujuver) >= LooseVersion('2'):
+ TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/maas_tpl'
+else:
+ TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/maas2/maas_tpl'
+
HOME = os.environ['HOME']
USER = os.environ['USER']