def Initialise(configFile): cfg=ottplib.LoadConfig(configFile,{'tolower':True}) if (cfg == None): ErrorExit("Error loading " + configFile) # Check for required arguments reqd = ['main:data centres'] for k in reqd: if (not cfg.has_key(k)): ErrorExit("The required configuration entry " + k + " is undefined") return cfg
def LoadConfig(configFile, reqd): Debug('Opening ' + configFile) cfg = ottplib.LoadConfig(configFile, {'tolower': True}) if (cfg == None): ErrorExit("Error loading " + configFile) # Check for required arguments for k in reqd: if (not cfg.has_key(k)): ErrorExit("The required configuration entry \'" + k + "\' is undefined") return cfg
def Initialise(configFile): cfg = ottplib.LoadConfig(configFile, {'tolower': True}) if (cfg == None): ErrorExit("Error loading " + configFile) # Check for required arguments reqd = [ 'counter:logger', 'receiver:pps offset', 'delays:reference cable', 'delays:antenna cable' ] for k in reqd: if (not cfg.has_key(k)): ErrorExit("The required configuration entry " + k + " is undefined") return cfg
def Initialise(configFile): cfg = ottplib.LoadConfig(configFile, {'tolower': True}) if (cfg == None): ErrorExit("Error loading " + configFile) # Check for required arguments reqd = [ 'counter:port', 'paths:counter data', 'counter:file extension', 'counter:lock file' ] for k in reqd: if (not cfg.has_key(k)): ErrorExit("The required configuration entry " + k + " is undefined") return cfg