Esempio n. 1
0
    def database_status(self):
        try:
            info = self.databaseinfra.get_info()
            if info is None:
                return None
            database_status = info.get_database_status(self.name)

            if database_status is None:
                # try get without cache
                info = self.databaseinfra.get_info(force_refresh=True)
                database_status = info.get_database_status(self.name)
        except ConnectionError, e:
            LOG.error(
                "ConnectionError calling database_status for database %s: %s" %
                (self, e))
            database_status = DatabaseStatus(self)
Esempio n. 2
0
    def database_status(self):
        try:
            info = self.databaseinfra.get_info()
            if info is None:
                return None
            database_status = info.get_database_status(self.name)

            if database_status is None:
                # try get without cache
                info = self.databaseinfra.get_info(force_refresh=True)
                database_status = info.get_database_status(self.name)
        except ConnectionError as e:
            msg = "ConnectionError calling database_status for database {}: {}".format(self, e)
            LOG.error(msg)
            database_status = DatabaseStatus(self)

        return database_status