Merge "Optimise the code style"

This commit is contained in:
Zuul 2018-02-07 18:04:14 +00:00 committed by Gerrit Code Review
commit 1a20abccf5
1 changed files with 9 additions and 10 deletions

View File

@ -245,16 +245,15 @@ def main():
else:
daemon = linux_daemon.Daemon(daemonizable=freezer_scheduler)
if CONF.action == 'start':
daemon.start()
elif CONF.action == 'stop':
daemon.stop()
elif CONF.action == 'restart':
daemon.restart()
elif CONF.action == 'reload':
daemon.reload()
elif CONF.action == 'status':
daemon.status()
_ACTION = {
'start': daemon.start,
'stop': daemon.stop,
'restart': daemon.restart,
'reload': daemon.reload,
'status': daemon.status
}
_ACTION.get(CONF.action)()
# 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