[daemon_base]fix error: syslog is not a member of DaemonBase (#4039)

This commit is contained in:
Stephen Sun 2020-02-08 04:34:29 +08:00 committed by Abhishek
parent 68f664beb6
commit 96f5a757ab

View File

@ -102,15 +102,15 @@ class DaemonBase(object):
# Signal handler # Signal handler
def signal_handler(self, sig, frame): def signal_handler(self, sig, frame):
if sig == signal.SIGHUP: if sig == signal.SIGHUP:
self.syslog.syslog(self.syslog.LOG_INFO, "Caught SIGHUP - ignoring...") syslog.syslog(syslog.LOG_INFO, "Caught SIGHUP - ignoring...")
elif sig == signal.SIGINT: elif sig == signal.SIGINT:
self.syslog.syslog(self.syslog.LOG_INFO, "Caught SIGINT - exiting...") syslog.syslog(syslog.LOG_INFO, "Caught SIGINT - exiting...")
sys.exit(128 + sig) sys.exit(128 + sig)
elif sig == signal.SIGTERM: elif sig == signal.SIGTERM:
self.syslog.syslog(self.syslog.LOG_INFO, "Caught SIGTERM - exiting...") syslog.syslog(syslog.LOG_INFO, "Caught SIGTERM - exiting...")
sys.exit(128 + sig) sys.exit(128 + sig)
else: else:
self.syslog.syslog(self.syslog.LOG_WARNING, "Caught unhandled signal '" + sig + "'") syslog.syslog(syslog.LOG_WARNING, "Caught unhandled signal '" + sig + "'")
# Returns platform and hwsku # Returns platform and hwsku
def get_platform_and_hwsku(self): def get_platform_and_hwsku(self):