Revision a9f33339 lib/backend.py
b/lib/backend.py | ||
---|---|---|
929 | 929 |
result[constants.NV_HVINFO] = hyper.GetNodeInfo(hvparams=hvparams) |
930 | 930 |
|
931 | 931 |
|
932 |
def VerifyNode(what, cluster_name, all_hvparams): |
|
932 |
def VerifyNode(what, cluster_name, all_hvparams, node_groups, groups_cfg):
|
|
933 | 933 |
"""Verify the status of the local node. |
934 | 934 |
|
935 | 935 |
Based on the input L{what} parameter, various checks are done on the |
... | ... | |
957 | 957 |
@param cluster_name: the cluster's name |
958 | 958 |
@type all_hvparams: dict of dict of strings |
959 | 959 |
@param all_hvparams: a dictionary mapping hypervisor names to hvparams |
960 |
@type node_groups: a dict of strings |
|
961 |
@param node_groups: node _names_ mapped to their group uuids (it's enough to |
|
962 |
have only those nodes that are in `what["nodelist"]`) |
|
963 |
@type groups_cfg: a dict of dict of strings |
|
964 |
@param groups_cfg: a dictionary mapping group uuids to their configuration |
|
960 | 965 |
@rtype: dict |
961 | 966 |
@return: a dictionary with the same keys as the input dict, and |
962 | 967 |
values representing the result of the checks |
... | ... | |
992 | 997 |
# Try to contact all nodes |
993 | 998 |
val = {} |
994 | 999 |
for node in nodes: |
995 |
success, message = _GetSshRunner(cluster_name).VerifyNodeHostname(node) |
|
1000 |
params = groups_cfg.get(node_groups.get(node)) |
|
1001 |
ssh_port = params["ndparams"].get(constants.ND_SSH_PORT) |
|
1002 |
logging.debug("Ssh port %s (None = default) for node %s", |
|
1003 |
str(ssh_port), node) |
|
1004 |
success, message = _GetSshRunner(cluster_name). \ |
|
1005 |
VerifyNodeHostname(node, ssh_port) |
|
996 | 1006 |
if not success: |
997 | 1007 |
val[node] = message |
998 | 1008 |
|
Also available in: Unified diff