def run(self): # Since the workers are modifying the configuration tree when doing the string interpolation # we save it as a string and replay it each iteration. original_node = ET.tostring(self.config) var_name = self.config.attrib["variable"] var_range = eval(self.config.attrib["range"]) self.logger.info("Starting variation loop, variable: %s, range: %s", var_name, var_range) wd = os.getcwd() for var in var_range: ctx = self.context ctx.update( {var_name : var} ) self.logger.info("Doing variation, variable: %s, value: %s", var_name, var) os.chdir(wd) wf = WorkerFactory(ET.ElementTree(self.config), self.context) wf.execute() self.config = ET.fromstring(original_node)
def run(self): # Since the workers are modifying the configuration tree when doing the string interpolation # we save it as a string and replay it each iteration. original_node = ET.tostring(self.config) var_name = self.config.attrib["variable"] var_range = eval(self.config.attrib["range"]) self.logger.info("Starting variation loop, variable: %s, range: %s", var_name, var_range) wd = os.getcwd() for var in var_range: ctx = self.context ctx.update({var_name: var}) self.logger.info("Doing variation, variable: %s, value: %s", var_name, var) os.chdir(wd) wf = WorkerFactory(ET.ElementTree(self.config), self.context) wf.execute() self.config = ET.fromstring(original_node)
def run(self): """ Runs its subworkers. """ wf = WorkerFactory(ET.ElementTree(self.config), self.context) wf.execute()