Exemple #1
0
 def healthcheck(self):
     path = self.conf.get('disable_by_file_path')
     if path is None:
         LOG.warning(
             _LW('DisableByFile healthcheck middleware enabled '
                 'without disable_by_file_path set'))
         return pluginbase.HealthcheckResult(available=True, reason="")
     elif not os.path.exists(path):
         return pluginbase.HealthcheckResult(available=True, reason="")
     else:
         return pluginbase.HealthcheckResult(available=False,
                                             reason="DISABLED BY FILE")
 def healthcheck(self):
     path = self.conf.get('disable_by_file_path')
     if path is None:
         LOG.warning(_LW('DisableByFile healthcheck middleware enabled '
                         'without disable_by_file_path set'))
         return pluginbase.HealthcheckResult(available=True,
                                             reason="")
     elif not os.path.exists(path):
         return pluginbase.HealthcheckResult(available=True,
                                             reason="")
     else:
         return pluginbase.HealthcheckResult(available=False,
                                             reason="DISABLED BY FILE")
 def healthcheck(self, server_port):
     path = self.status_files.get(server_port)
     if not path:
         LOG.warning(
             _LW('DisableByFilesPorts healthcheck middleware'
                 ' enabled without disable_by_file_paths set'
                 ' for port %s') % server_port)
         return pluginbase.HealthcheckResult(available=True, reason="OK")
     else:
         if not os.path.exists(path):
             return pluginbase.HealthcheckResult(available=True,
                                                 reason="OK")
         else:
             return pluginbase.HealthcheckResult(available=False,
                                                 reason="DISABLED BY FILE")
 def healthcheck(self, server_port):
     path = self.status_files.get(server_port)
     if not path:
         LOG.warning(_LW('DisableByFilesPorts healthcheck middleware'
                         ' enabled without disable_by_file_paths set'
                         ' for port %s') % server_port)
         return pluginbase.HealthcheckResult(available=True,
                                             reason="OK")
     else:
         if not os.path.exists(path):
             return pluginbase.HealthcheckResult(available=True,
                                                 reason="OK")
         else:
             return pluginbase.HealthcheckResult(available=False,
                                                 reason="DISABLED BY FILE")
 def healthcheck(self, server_port):
     path = self.conf.get('disable_by_file_path')
     if path is None:
         LOG.warning(_LW('DisableByFile healthcheck middleware enabled '
                         'without disable_by_file_path set'))
         return pluginbase.HealthcheckResult(
             available=True, reason="OK",
             details="No 'disable_by_file_path' configuration value"
                     " specified")
     elif not os.path.exists(path):
         return pluginbase.HealthcheckResult(
             available=True, reason="OK",
             details="Path '%s' was not found" % path)
     else:
         return pluginbase.HealthcheckResult(
             available=False, reason="DISABLED BY FILE",
             details="Path '%s' was found" % path)
 def healthcheck(self, server_port):
     path = self._conf_get('disable_by_file_path')
     if not path:
         LOG.warning(
             _LW('DisableByFile healthcheck middleware enabled '
                 'without disable_by_file_path set'))
         return pluginbase.HealthcheckResult(
             available=True,
             reason="OK",
             details="No 'disable_by_file_path' configuration value"
             " specified")
     elif not os.path.exists(path):
         return pluginbase.HealthcheckResult(
             available=True,
             reason="OK",
             details="Path '%s' was not found" % path)
     else:
         return pluginbase.HealthcheckResult(available=False,
                                             reason="DISABLED BY FILE",
                                             details="Path '%s' was found" %
                                             path)