Commit 937f983d authored by Guido Trotter's avatar Guido Trotter
Browse files

Change fping to TcpPing in two LUs

Two LUs are using RunCmd to call fping, in order to check for an IP
presence on the network. Substituting it with TcpPing will get rid of
it, which makes it not break in the new world order, where the master
cannot fork.

Reviewed-by: iustinp
parent 6d8b6238
......@@ -880,8 +880,7 @@ class LURenameCluster(LogicalUnit):
raise errors.OpPrereqError("Neither the name nor the IP address of the"
" cluster has changed")
if new_ip != old_ip:
result = utils.RunCmd(["fping", "-q", new_ip])
if not result.failed:
if utils.TcpPing(new_ip, constants.DEFAULT_NODED_PORT):
raise errors.OpPrereqError("The given cluster IP address (%s) is"
" reachable on the network. Aborting." %
......@@ -2284,9 +2283,7 @@ class LURenameInstance(LogicalUnit):
if not getattr(self.op, "ignore_ip", False):
command = ["fping", "-q", name_info.ip]
result = utils.RunCmd(command)
if not result.failed:
if utils.TcpPing(name_info.ip, constants.DEFAULT_NODED_PORT):
raise errors.OpPrereqError("IP %s of instance %s already in use" %
(name_info.ip, new_name))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment