summaryrefslogtreecommitdiffstats
path: root/ci/genMAASConfig.py
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2016-11-03 06:50:09 -0500
committerNarinder Gupta <narinder.gupta@canonical.com>2016-11-03 07:56:13 -0500
commite63f44eb68b9e87b9b99a135fe75f9f9e84b1103 (patch)
treee7ea6e3d0c89a961e1562e5fff5489a624758d18 /ci/genMAASConfig.py
parent769c8026c814a4746db2bd7ff1cd2937e74381bd (diff)
added support for maas 2.0 in non virtualized environment.
Change-Id: Icf024ed2cbf538df43e6bd5203685552ab6564d2 Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
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']