- # 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)