From: Jay S. Bryant Date: Fri, 20 Feb 2015 22:29:10 +0000 (-0600) Subject: Sync 'service' module from oslo-incubator X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ecd24c96c821fd3c9ae3e583357ff0e4cb371c5b;p=openstack-build%2Fcinder-build.git Sync 'service' module from oslo-incubator The service module hasn't had a sync to Cinder since November of 2014. There have been a number of changes, including updates to get it using the appropriate namespace for oslo and support for moving away from using oslo.log. So, we need to update the module. Current HEAD in OSLO: --------------------- commit e589dde0721a0a67e4030813e582afec6e70d042 Date: Wed Feb 18 03:08:12 2015 +0000 Merge "Have a little fun with release notes" Changes merged with this patch: --------------------- 2aacb111 - Change oslo.config to oslo_config 2fbf5065 - Remove oslo.log code and clean up versionutils API dbca53e9 - Merge "Added graceful argument on Service.stop method" 442fc223 - Added graceful argument on Service.stop method cf429e50 - Remove extra white space in log message Change-Id: If78596d8779b8dd5b2fc22891d7ca21ccdabc9d6 --- diff --git a/cinder/openstack/common/service.py b/cinder/openstack/common/service.py index e2c57d7d0..910d2bbbc 100644 --- a/cinder/openstack/common/service.py +++ b/cinder/openstack/common/service.py @@ -18,7 +18,7 @@ """Generic Node base class for all workers that run on hosts.""" import errno -import logging as std_logging +import logging import os import random import signal @@ -39,7 +39,6 @@ from oslo.config import cfg from cinder.openstack.common import eventlet_backdoor from cinder.openstack.common._i18n import _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import systemd from cinder.openstack.common import threadgroup @@ -163,7 +162,7 @@ class ServiceLauncher(Launcher): signo = 0 LOG.debug('Full set of CONF:') - CONF.log_opt_values(LOG, std_logging.DEBUG) + CONF.log_opt_values(LOG, logging.DEBUG) try: if ready_callback: @@ -377,7 +376,7 @@ class ProcessLauncher(object): systemd.notify_once() LOG.debug('Full set of CONF:') - CONF.log_opt_values(LOG, std_logging.DEBUG) + CONF.log_opt_values(LOG, logging.DEBUG) try: while True: @@ -397,7 +396,7 @@ class ProcessLauncher(object): self.running = True self.sigcaught = None except eventlet.greenlet.GreenletExit: - LOG.info(_LI("Wait called after thread killed. Cleaning up.")) + LOG.info(_LI("Wait called after thread killed. Cleaning up.")) self.stop() @@ -434,8 +433,8 @@ class Service(object): def start(self): pass - def stop(self): - self.tg.stop() + def stop(self, graceful=False): + self.tg.stop(graceful) self.tg.wait() # Signal that service cleanup is done: if not self._done.ready():