Optimise the code style

the change is not means bugs, just optimise the code style.

Change-Id: I5f8873717f232b1b7266ec56aeae0dc982157c99
This commit is contained in:
caoyuan 2018-01-30 22:12:59 +08:00 committed by Saad Zaher
parent 238bd3eca8
commit a8f776cc77
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