diff options
Diffstat (limited to 'src/flufigut.py')
-rwxr-xr-x | src/flufigut.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/flufigut.py b/src/flufigut.py index 2f3b2c2..d2ef659 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -47,7 +47,12 @@ def rand_string(size=8, chars=string.ascii_lowercase + string.ascii_uppercase + ### parse json file ############################################# # if len(sys.argv) <= 2: - raise SystemExit("ERROR: No template name and or configuration file given") + raise SystemExit("ERROR: No output format and or configuration file given") + +output_format = sys.argv[1] + +if output_format != 'flumotion': + raise SystemExit("OUTPUT FORMAT: currently only flumotion configuration files can be generated") cf = open(sys.argv[2], 'r') config = json.load(cf); @@ -365,7 +370,7 @@ if error != 0: import shutil shutil.rmtree('output', ignore_errors=True) -env = Environment(loader=FileSystemLoader('../templates/%s/' % (sys.argv[1])), line_statement_prefix = '%%') +env = Environment(loader=FileSystemLoader('../templates/%s/' % (globals['templates'])), line_statement_prefix = '%%') print "generating planet '%s/%s'" % (globals['manager']['machine'], globals['name']) template = env.get_template('planet.xml') |