"-s", master_ip, master_ip])
# we'll ignore the exit code of arping
- # Start remote API
- result = utils.RunCmd(["ganeti-rapi", "--port=%s" % constants.RAPI_PORT])
- if debug and result.failed:
- sys.stderr.write("Failed to start ganeti-rapi, error: %s\n" %
- result.output)
+ if constants.RAPI_ENABLE:
+ # Start remote API
+ result = utils.RunCmd(["ganeti-rapi", "--port=%s" % constants.RAPI_PORT])
+ if debug and result.failed:
+ sys.stderr.write("Failed to start ganeti-rapi, error: %s\n" %
+ result.output)
return EXIT_OK
"""Stops the master.
"""
- # Stop remote API
- result = utils.RunCmd(["fuser", "-k", "-n", "tcp", str(constants.RAPI_PORT)])
- if debug and result.failed:
- sys.stderr.write("Failed to stop ganeti-rapi, error: %s\n" % result.output)
+ if constants.RAPI_ENABLE:
+ # Stop remote API
+ result = utils.RunCmd(["fuser", "-k", "-n", "tcp",
+ str(constants.RAPI_PORT)])
+ if debug and result.failed:
+ sys.stderr.write("Failed to stop ganeti-rapi, error: %s\n" %
+ result.output)
result = utils.RunCmd(["ip", "address", "del", "%s/32" % master_ip,
"dev", master_netdev])