def setup_logging(): logging.setup(CONF, 'kuryr-kubernetes') logging.set_defaults(default_log_levels=logging.get_default_log_levels()) version_k8s = pbr.version.VersionInfo('kuryr-kubernetes').version_string() LOG.info(_LI("Logging enabled!")) LOG.info(_LI("%(prog)s version %(version)s"), {'prog': sys.argv[0], 'version': version_k8s})
def start(self): # TODO(devvesa): Remove this line as soon as it does anything LOG.info(_LI("I am doing nothing")) try: while (True): time.sleep(5) # TODO(devvesa): Remove this line as soon as does anything LOG.info(_LI("Keep doing nothing")) finally: sys.exit(1)
def _watch(self, path): try: LOG.info(_LI("Started watching '%s'"), path) for event in self._client.watch(path): self._idle[path] = False self._handler(event) self._idle[path] = True if not (self._running and path in self._resources): return finally: self._watching.pop(path) self._idle.pop(path) LOG.info(_LI("Stopped watching '%s'"), path)
def stop(self, graceful=False): LOG.info(_LI("Service '%s' stopping"), self.__class__.__name__) self.watcher.stop() super(KuryrK8sService, self).stop(graceful)
def wait(self): super(KuryrK8sService, self).wait() LOG.info(_LI("Service '%s' stopped"), self.__class__.__name__)
def start(self): LOG.info(_LI("Service '%s' starting"), self.__class__.__name__) super(KuryrK8sService, self).start() self.watcher.start() LOG.info(_LI("Service '%s' started"), self.__class__.__name__)