This patch adds a mechanism to disable utils.RunCmd in selected
programs. This is needed in the master daemon unless we confirm
threading doesn't pose any problems.
This makes cluster init fail, but creating new trunk clusters is anyway
broken at the moment.
Reviewed-by: ultrotter
options, args = ParseOptions()
utils.debug = options.debug
+ utils.no_fork = True
CheckMaster(options.debug)
_re_shell_unquoted = re.compile('^[-.,=:/_+@A-Za-z0-9]+$')
debug = False
+no_fork = False
class RunResult(object):
Returns: `RunResult` instance
"""
+ if no_fork:
+ raise errors.ProgrammerError("utils.RunCmd() called with fork() disabled")
+
if isinstance(cmd, list):
cmd = [str(val) for val in cmd]
strcmd = " ".join(cmd)