Commit 909b3a0e authored by Andrea Spadaccini's avatar Andrea Spadaccini
Browse files

Restore backend.GetMasterInfo return values order

Change 5a8648eb

 changed the order of the
return values of backend.GetMasterInfo(). This broke the users of the
master_info RPC.

This change restores the original order, and adds a comment in about the new value added to the return values of
Signed-off-by: default avatarAndrea Spadaccini <>
Reviewed-by: default avatarIustin Pop <>
parent 5a8648eb
......@@ -231,8 +231,8 @@ def GetMasterInfo():
for consumption here or from the node daemon.
@rtype: tuple
@return: master_netdev, master_ip, master_netmask, master_name,
@return: master_netdev, master_ip, master_name, primary_ip_family,
@raise RPCFail: in case of errors
......@@ -245,8 +245,8 @@ def GetMasterInfo():
primary_ip_family = cfg.GetPrimaryIPFamily()
except errors.ConfigurationError, err:
_Fail("Cluster configuration incomplete: %s", err, exc=True)
return (master_netdev, master_ip, master_netmask, master_node,
return (master_netdev, master_ip, master_node, primary_ip_family,
def ActivateMasterIp():
......@@ -254,7 +254,7 @@ def ActivateMasterIp():
# GetMasterInfo will raise an exception if not able to return data
master_netdev, master_ip, master_netmask, _, family = GetMasterInfo()
master_netdev, master_ip, _, family, master_netmask = GetMasterInfo()
err_msg = None
if netutils.TcpPing(master_ip, constants.DEFAULT_NODED_PORT):
......@@ -328,7 +328,7 @@ def DeactivateMasterIp():
# need to decide in which case we fail the RPC for this
# GetMasterInfo will raise an exception if not able to return data
master_netdev, master_ip, master_netmask, _, _ = GetMasterInfo()
master_netdev, master_ip, _, _, master_netmask = GetMasterInfo()
result = utils.RunCmd([constants.IP_COMMAND_PATH, "address", "del",
"%s/%s" % (master_ip, master_netmask),
......@@ -360,7 +360,7 @@ def ChangeMasterNetmask(netmask):
"""Change the netmask of the master IP.
master_netdev, master_ip, old_netmask, _, _ = GetMasterInfo()
master_netdev, master_ip, _, _, old_netmask = GetMasterInfo()
if old_netmask == netmask:
......@@ -796,7 +796,8 @@ def GatherMasterVotes(node_list):
if msg:
logging.warning("Error contacting node %s: %s", node, msg)
fail = True
# for now we accept both length 3 and 4 (data[3] is primary ip version)
# for now we accept both length 3, 4 and 5 (data[3] is primary ip version
# and data[4] is the master netmask)
elif not isinstance(data, (tuple, list)) or len(data) < 3:
logging.warning("Invalid data received from node %s: %s", node, data)
fail = True
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