Added overright option for haproxy restart command
This commit is contained in:
parent
7ea8dd83b3
commit
3835bd85b0
|
@ -103,6 +103,17 @@ class HAProxyInstaller(common.Plugin):
|
||||||
type=str,
|
type=str,
|
||||||
default=constants.os_constant('crt_directory')
|
default=constants.os_constant('crt_directory')
|
||||||
)
|
)
|
||||||
|
add(
|
||||||
|
"haproxy-restart",
|
||||||
|
help=(
|
||||||
|
"Override the default command to restart haproxy."
|
||||||
|
" Default for this OS is \"{}\"".format(
|
||||||
|
constants.os_constant('restart_cmd')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
type=str,
|
||||||
|
default=constants.os_constant('restart_cmd')
|
||||||
|
)
|
||||||
add(
|
add(
|
||||||
"haproxy-config",
|
"haproxy-config",
|
||||||
help=(
|
help=(
|
||||||
|
@ -555,7 +566,14 @@ class HAProxyInstaller(common.Plugin):
|
||||||
"""
|
"""
|
||||||
self.config_test()
|
self.config_test()
|
||||||
try:
|
try:
|
||||||
util.run_script(constants.os_constant("restart_cmd"))
|
# read the haproxy-restart command. per default this is an array
|
||||||
|
# if it is overwritten by the user, it is a string, so we have
|
||||||
|
# to split it over spaces. This works not correctly if a user
|
||||||
|
# has quoted arguments (with spaces)
|
||||||
|
cmd = self.conf('haproxy-restart')
|
||||||
|
if isinstance(cmd, basestring):
|
||||||
|
cmd = cmd.split()
|
||||||
|
util.run_script(cmd)
|
||||||
except errors.SubprocessError as err:
|
except errors.SubprocessError as err:
|
||||||
raise errors.MisconfigurationError(str(err))
|
raise errors.MisconfigurationError(str(err))
|
||||||
|
|
||||||
|
|
Reference in New Issue