Merge "Optimise the code style"
This commit is contained in:
commit
1a20abccf5
|
@ -245,16 +245,15 @@ def main():
|
||||||
else:
|
else:
|
||||||
daemon = linux_daemon.Daemon(daemonizable=freezer_scheduler)
|
daemon = linux_daemon.Daemon(daemonizable=freezer_scheduler)
|
||||||
|
|
||||||
if CONF.action == 'start':
|
_ACTION = {
|
||||||
daemon.start()
|
'start': daemon.start,
|
||||||
elif CONF.action == 'stop':
|
'stop': daemon.stop,
|
||||||
daemon.stop()
|
'restart': daemon.restart,
|
||||||
elif CONF.action == 'restart':
|
'reload': daemon.reload,
|
||||||
daemon.restart()
|
'status': daemon.status
|
||||||
elif CONF.action == 'reload':
|
}
|
||||||
daemon.reload()
|
|
||||||
elif CONF.action == 'status':
|
_ACTION.get(CONF.action)()
|
||||||
daemon.status()
|
|
||||||
|
|
||||||
# os.RETURN_CODES are only available to posix like systems, on windows
|
# os.RETURN_CODES are only available to posix like systems, on windows
|
||||||
# we need to translate the code to an actual number which is the equivalent
|
# we need to translate the code to an actual number which is the equivalent
|
||||||
|
|
Loading…
Reference in New Issue