Skip to content

Commit

Permalink
Fixed #2 reload verb without ExecReload
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilvij committed Aug 23, 2012
1 parent 7541aae commit 108dde7
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions converter.py
Expand Up @@ -608,12 +608,6 @@ def build_default_params():
print "STARTTIMEOUT=%s" % (config.get("Service", "TimeoutSec")[0])

def build_call_arguments():
if config.has_option("Service", "ExecReload"):
exec_reload = '{start|stop|reload|force-reload|restart}"'

else:
exec_reload = '{start|stop|force-reload|restart}"'

print (
'case "$1" in\n'
'\tstart)\n'
Expand All @@ -622,19 +616,30 @@ def build_call_arguments():
'\tstop)\n'
'\t\tstop\n'
'\t\t;;\n'
'\treload)\n'
'\t\treload\n'
'\t\t;;\n'
'\tforce-reload)\n'
'\t\tforce_reload\n'
'\t\t;;\n'
'\trestart)\n'
'\t\tstop\n'
'\t\tstart\n'
'\t\t;;\n'
'\t* )\n'
'\t\techo "$Usage: $prog %s"\n'
'esac') % (exec_reload)
'\t\t;;\n')

if config.has_option("Service", "ExecReload"):
exec_reload = '{start|stop|reload|force-reload|restart}'
print ( '\treload)\n'
'\t\treload\n'
'\t\t;;\n'
'\t*)\n'
'\t\techo "$Usage: $prog %s"\n'
'\t\texit2\n'
'esac') % (exec_reload)

else:
exec_reload = '{start|stop|force-reload|restart}'
print ( '\t*)\n'
'\t\techo "$Usage: $prog %s"\n'
'\t\texit 2\n'
'esac') % (exec_reload)

# The build_{start,stop,reload} functions will be called irrespective of the
# existence of Exec{Start,Stop,Reload} options. This is to ensure that all the
Expand Down

0 comments on commit 108dde7

Please sign in to comment.