2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-21 05:25:32 +00:00

Merge pull request #6760 from gurevichmark/clusterstate_probe

Enable clusterstatus xcatprobe on Perl 5.23
This commit is contained in:
besawn
2020-07-10 16:05:34 -04:00
committed by GitHub
8 changed files with 19 additions and 15 deletions

View File

@ -45,6 +45,8 @@ my %type_nodesnum = ();
# matching --> matched --> installing --> booting --> booted
# matching --> matched --> booting --> installing --> xxx --> booted
# The terminal state is configured(For PDU/Switch) or booted(for Node)
# matching means node found matching the range, but no status attribute value
# matched means node found matching the range, with mac attribute value, but no status attribute value
#-----------------------------
my %state_node_hash = ();
@ -240,7 +242,7 @@ sub update_nodes_info {
foreach (@unmatched_nodes_attributes) {
if (/^(.*):\s*mac=(.*)$/) {
if ($2) {
update_node_info($1, "Matched");
update_node_info($1, "matched (no status)");
}
}
}
@ -279,7 +281,7 @@ sub update_node_info {
if (exists($state_node_hash{$node_type}{$node_state}{$node})) {
delete($state_node_hash{$node_type}{$node_state}{$node});
}
unless (scalar keys ($state_node_hash{$node_type}{$node_state})) {
unless (scalar keys (%{$state_node_hash{$node_type}{$node_state}})) {
delete($state_node_hash{$node_type}{$node_state});
}
@ -307,10 +309,10 @@ sub check_nodes_attributes {
$node_info{$_}{state} = $nodehash{$_}{status};
$unfinished_nodes{$_} = 1;
} elsif ($nodehash{$_}{mac}) {
$node_info{$_}{state} = "Matched";
$node_info{$_}{state} = "matched (no status)";
$unfinished_nodes{$_} = 1;
} else {
$node_info{$_}{state} = "matching";
$node_info{$_}{state} = "matching (no status, no mac)";
$unmatched_nodes{$_} = 1;
}
if ($nodehash{$_}{mgt} eq 'pdu') {

View File

@ -144,7 +144,7 @@ if ($help) {
}
if ($test) {
probe_utils->send_msg("$output", "o", "This isn't a probe tool, this is just a template for sub command coding. Using it to develop sub command which need to cover hierarchical cluster");
probe_utils->send_msg("$output", "o", "This isn't a probe tool, this is just a template for sub command coding. Use it to develop sub command which need to cover hierarchical cluster");
exit 0;
}

View File

@ -139,7 +139,7 @@ sub get_cmd
foreach (@hdisk)
{
`lspv|grep $_ >/dev/nul 2>&1`;
`lspv|grep $_ >/dev/null 2>&1`;
$err++ if ($? != 0)
}
@ -152,7 +152,7 @@ sub get_cmd
next;
}
`lsvg $key > /dev/nul 2>&1`;
`lsvg $key > /dev/null 2>&1`;
if ($? == 0)
{
#print "Invalid configuration item $key: vg $key already existed\n";
@ -193,7 +193,7 @@ sub get_cmd
next;
}
`su - padmin " -c ioscli lslv $conf[0]" > /dev/nul 2>&1`;
`su - padmin " -c ioscli lslv $conf[0]" > /dev/null 2>&1`;
if ($? == 0)
{
#print "Invalid configuration item $key:the lv name $conf[0] already existed\n";
@ -203,7 +203,7 @@ sub get_cmd
next;
}
`su - padmin " -c ioscli lsvg $conf[1]" > /dev/nul 2>&1`;
`su - padmin " -c ioscli lsvg $conf[1]" > /dev/null 2>&1`;
if ($? != 0)
{
#print "Invalid configuration item $key:the vg $conf[1] doesn't exist\n";
@ -242,7 +242,7 @@ sub get_cmd
print "Mapping logical volumes to virtual adapters...";
while (my ($key, $value) = each %config)
{
`su - padmin " -c ioscli lslv $value" > /dev/nul 2>&1`;
`su - padmin " -c ioscli lslv $value" > /dev/null 2>&1`;
if ($? != 0)
{
#print "Invalid configuration item $key: lv $value doesn't exist\n";
@ -252,7 +252,7 @@ sub get_cmd
next;
}
`su - padmin " -c ioscli lsdev -virtual |grep $key " >/dev/nul 2>&1`;
`su - padmin " -c ioscli lsdev -virtual |grep $key " >/dev/null 2>&1`;
if ($? != 0)
{
#print "Invaild configuration item $key: virtual adapter $key doesn't exist\n";

View File

@ -1173,7 +1173,7 @@ sub send_email {
sub git_update {
send_msg(2, "[git update] starting to update xcat source code from git");
my $res = system("cd $xcatcoredir && git checkout $branch > /dev/nul 2>&1");
my $res = system("cd $xcatcoredir && git checkout $branch > /dev/null 2>&1");
if ($res != 0) {
send_msg(0, "[git update] change to branch $branch....[failed]");
return 2;
@ -1198,7 +1198,7 @@ sub git_update {
return 2;
}
$res = system("grep 'Already up-to-date' $gitpulloutput > /dev/nul 2>&1");
$res = system("grep 'Already up-to-date' $gitpulloutput > /dev/null 2>&1");
if ($res == 0 && !$forceregwithoutupdate) {
send_msg(2, "[git update] code is already at latest version. exit regresson");
return 1;

View File

@ -17,6 +17,7 @@ bmcdiscover_range_z
bmcdiscover_help
bmcdiscover_q
bmcdiscover_version
xcatprobe_work
confignetwork_static_installnic
get_xcat_postscripts_loginfo
nodeset_cmdline

View File

@ -17,6 +17,7 @@ bmcdiscover_range_z
bmcdiscover_help
bmcdiscover_q
bmcdiscover_version
xcatprobe_work
confignetwork_static_installnic
get_xcat_postscripts_loginfo
nodeset_cmdline

View File

@ -6,7 +6,7 @@
#
BINARIES="ofed_info mst ibdev2netdev"
for PROG in ${BINARIES}; do
RC=`command -v ${PROG} >> /dev/nul 2>&1; echo $?`
RC=`command -v ${PROG} >> /dev/null 2>&1; echo $?`
if [[ ${RC} != 0 ]]; then
echo "${PROG} is not installed on this node, unable to check firmware levels."
exit 1

View File

@ -29,7 +29,7 @@ function logerr {
#check if mlnx ofed commands are installed
COMMANDS="ofed_info mst mlxconfig"
for CMD in ${COMMANDS}; do
RC=`command -v ${CMD} >> /dev/nul 2>&1; echo $?`
RC=`command -v ${CMD} >> /dev/null 2>&1; echo $?`
if [[ ${RC} != 0 ]]; then
ERRMSG="Command: ${CMD} is not found, unable to run the scripts"
logerr $ERRMSG