def checkConfiguration(self, care=1, issueExc=None): """Runs checks that ensure that the Workflow has been properly set up. Raises ------ MultiIssueConfigurationError if problems are found Parameters ---------- care : `int` the thoroughness of the checks. In general, a higher number will result in more checks. issueExc : `MultiIssueConfigurationError` An instance of MultiIssueConfigurationError to add problems to. If not None, this function will not raise an exception when problems are encountered; they will merely be added to the instance. It is assumed that the caller will raise that exception is necessary. """ log.debug("WorkflowManager:createConfiguration") myProblems = issueExc if myProblems is None: myProblems = MultiIssueConfigurationError("problems encountered while checking configuration") # do the checks # raise exception if problems found if not issueExc and myProblems.hasProblems(): raise myProblems
def testNoProb(self): err = MultiIssueConfigurationError() self.assertFalse(err.hasProblems()) self.assertEqual(str(err), self.unspecified) probs = err.getProblems() self.assertEqual(len(probs), 0)
def checkConfiguration(self, care=1, issueExc=None): """Carry out production-wide configuration checks. Parameters ---------- care : `int` throughness level of the checks issueExc : `MultiIssueConfigurationError` an instance of MultiIssueConfigurationError to add problems to Raises ------ `MultiIssueConfigurationError` If issueExc is None, and a configuration error is detected. Notes ----- If issueExc is not None, this method will not raise an exception when problems are encountered; they will merely be added to the instance. It is assumed that the caller will raise the exception as necessary. """ log.debug("checkConfiguration") myProblems = issueExc if myProblems is None: myProblems = MultiIssueConfigurationError("problems encountered while checking configuration") for dbconfig in self._databaseConfigurators: print("-> dbconfig = ", dbconfig) dbconfig.checkConfiguration(care, issueExc) if not issueExc and myProblems.hasProblems(): raise myProblems
def checkConfiguration(self, care=1, issueExc=None): """Carry out production-wide configuration checks. Parameters ---------- care : `int` throughness level of the checks issueExc : `MultiIssueConfigurationError` an instance of MultiIssueConfigurationError to add problems to Raises ------ `MultiIssueConfigurationError` If issueExc is None, and a configuration error is detected. Notes ----- If issueExc is not None, this method will not raise an exception when problems are encountered; they will merely be added to the instance. It is assumed that the caller will raise the exception as necessary. """ log.debug("checkConfiguration") myProblems = issueExc if myProblems is None: myProblems = MultiIssueConfigurationError( "problems encountered while checking configuration") for dbconfig in self._databaseConfigurators: print("-> dbconfig = ", dbconfig) dbconfig.checkConfiguration(care, issueExc) if not issueExc and myProblems.hasProblems(): raise myProblems
def checkConfiguration(self, care=1, issueExc=None): log.debug("checkConfiguration") myProblems = issueExc if myProblems is None: myProblems = MultiIssueConfigurationError("problems encountered while checking configuration") for dbconfig in self._databaseConfigurators: print "-> dbconfig = ",dbconfig dbconfig.checkConfiguration(care, issueExc) if not issueExc and myProblems.hasProblems(): raise myProblems