X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/3e5b3d878ce26aef3ab15f1dafebd2023ca66826..130440e7d0f26fb256b801c1474dccfe6f3cb76c:/daemons/ganeti-master diff --git a/daemons/ganeti-master b/daemons/ganeti-master index 5d882fc..b13ed98 100755 --- a/daemons/ganeti-master +++ b/daemons/ganeti-master @@ -128,11 +128,12 @@ def StartMaster(master_netdev, master_ip, debug): "-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 @@ -141,10 +142,13 @@ def StopMaster(master_netdev, master_ip, debug): """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])