def runPolicy(policy, usermap, test, loggerName, debug): """ Schedule the policy to be enforced @type policy: policy object @param policy: The policy to be scheduled @type usermap: dictionary @param usermap: A dictionary containing EUDAT global username as keys and local B2SAFE username as values @type test: boolean @param test: If True, the code is executed without performing real operations @type loggerName: string @param loggerName: The name of the logger @type debug: boolean @param debug: If True the debug is enabled """ runner = PolicyRunner(usermap, test, loggerName, debug) errMsg = runner.runPolicy(policy) if errMsg is not None: print 'ERROR: ' + errMsg exit(1)
def runPolicy(policy, usermap, test, loggerName, debug): runner = PolicyRunner(usermap, test, loggerName, debug) runner.runPolicy(policy)