Commit 412e951c authored by cpomies's avatar cpomies
Browse files

Added parameter preconditions in property file

parent 2b010853
......@@ -20,14 +20,6 @@ import os
from LbNightlyTools.Configuration import load
from LbNightlyTools.Utils import JobParams
def parseConfigFile(path):
'''
Extract required information from the configuration file.
'''
data = load(path)
return data.get(u'preconditions', [])
import LbUtils.Script
class Script(LbUtils.Script.PlainScript):
'''
......@@ -72,6 +64,7 @@ class Script(LbUtils.Script.PlainScript):
slot_build_id=os.environ['slot_build_id'],
platform=platform,
os_label=os_label,
preconditions=preconds
)) + '\n')
self.log.debug('%s written', output_file_name)
......
......@@ -88,7 +88,11 @@ class Script(LbUtils.Script.PlainScript):
if len(self.args) != 1:
self.parser.error('wrong number of arguments')
preconds = parseConfigFile(self.args[0])
if os.environ.has_key('preconditions') \
and os.environ['preconditions'] != '':
preconds = dict(os.environ.has_key('preconditions'))
else:
preconds = parseConfigFile(self.args[0])
from LbNightlyTools.Utils import setDayNamesEnv
setDayNamesEnv()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment