small code cleanup w/o affecting functionalities
Change-Id: I98c3e403a0a4537afcc8553a7d2d59b791e4b26a
This commit is contained in:
parent
ff2db3c748
commit
89d379e5e7
@ -124,7 +124,7 @@ class RequestContext(object):
|
||||
|
||||
return cls(**values)
|
||||
|
||||
def elevated(self, read_deleted=None, overwrite=False):
|
||||
def elevated(self, read_deleted=None):
|
||||
"""Return a version of this context with admin flag set."""
|
||||
context = copy.copy(self)
|
||||
context.is_admin = True
|
||||
|
@ -38,13 +38,13 @@ class Manager(Thread):
|
||||
self.managers = {}
|
||||
|
||||
def execute(self, command, *args, **kargs):
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
def task(self):
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
def doOnEvent(self, event_type, *args, **kargs):
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
def getManagers(self):
|
||||
return self.managers
|
||||
@ -88,10 +88,10 @@ class Manager(Thread):
|
||||
is created.
|
||||
Child classes should override this method.
|
||||
"""
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
def destroy(self):
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
def getStatus(self):
|
||||
return self.status
|
||||
|
@ -106,7 +106,7 @@ class SynergyObject(object):
|
||||
|
||||
class SynergySerializer(oslo_messaging.Serializer):
|
||||
def __init__(self):
|
||||
super(oslo_messaging.Serializer, self).__init__()
|
||||
super(SynergySerializer, self).__init__()
|
||||
|
||||
def serialize_entity(self, context, entity):
|
||||
if not entity:
|
||||
|
@ -38,7 +38,7 @@ class Service(object):
|
||||
signal.signal(signal.SIGTERM, self.sigterm_handler)
|
||||
signal.signal(signal.SIGINT, self.sigterm_handler)
|
||||
|
||||
def sigterm_handler(self, signum, frame):
|
||||
def sigterm_handler(self):
|
||||
global SIGTERM_SENT
|
||||
if not SIGTERM_SENT:
|
||||
LOG.info("Shutting down %s" % self.name)
|
||||
@ -52,13 +52,13 @@ class Service(object):
|
||||
return self.name
|
||||
|
||||
def start(self):
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
def stop(self):
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
def wait(self):
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
def restart(self):
|
||||
# Reload config files and restart service
|
||||
|
@ -28,6 +28,6 @@ def import_class(import_str):
|
||||
try:
|
||||
return getattr(sys.modules[mod_str], class_str)
|
||||
except AttributeError:
|
||||
raise ImportError('Class %s cannot be found (%s)' %
|
||||
(class_str,
|
||||
traceback.format_exception(*sys.exc_info())))
|
||||
raise ImportError(
|
||||
'Class %s cannot be found (%s)' %
|
||||
(class_str, traceback.format_exception(*sys.exc_info())))
|
||||
|
@ -73,7 +73,6 @@ class ManagerRPC(object):
|
||||
% (ex))
|
||||
|
||||
result[name] = manager.getStatus()
|
||||
pass
|
||||
|
||||
return result
|
||||
|
||||
@ -97,7 +96,6 @@ class ManagerRPC(object):
|
||||
% (ex))
|
||||
|
||||
result[name] = manager.getStatus()
|
||||
pass
|
||||
|
||||
return result
|
||||
|
||||
@ -367,7 +365,6 @@ class Synergy(service.Service):
|
||||
"%s" % (ex))
|
||||
|
||||
result[name]["message"] = "ERROR: %s" % ex
|
||||
pass
|
||||
else:
|
||||
result[name]["message"] = "WARN: already started"
|
||||
|
||||
@ -416,7 +413,6 @@ class Synergy(service.Service):
|
||||
% (ex))
|
||||
|
||||
result[name]["message"] = "ERROR: %s" % ex
|
||||
pass
|
||||
else:
|
||||
result[name]["message"] = "WARN: already stopped"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user