2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #3076 from gurevichmark/rinv_format

OpenBMC rinv sorted output
This commit is contained in:
Victor Hu 2017-05-17 22:20:37 -04:00 committed by GitHub
commit ff4fd41e6e
3 changed files with 22 additions and 11 deletions

View File

@ -32,14 +32,14 @@ OpenPOWER (using ipmi) server specific:
=======================================
\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ }
\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ ]
OpenPOWER (using openbmc) server specific:
==========================================
\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ }
\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ ]
PPC (with HMC) specific:

View File

@ -12,11 +12,11 @@ B<rinv> I<noderange> {B<pci>|B<model>|B<serial>|B<asset>|B<vpd>|B<mprom>|B<devic
=head2 OpenPOWER (using ipmi) server specific:
B<rinv> I<noderange> {B<model>|B<serial>|B<deviceid>|B<uuid>|B<guid>|B<vpd>|B<mprom>|B<firm>|B<all>}
B<rinv> I<noderange> [B<model>|B<serial>|B<deviceid>|B<uuid>|B<guid>|B<vpd>|B<mprom>|B<firm>|B<all>]
=head2 OpenPOWER (using openbmc) server specific:
B<rinv> I<noderange> {B<model>|B<serial>|B<deviceid>|B<uuid>|B<guid>|B<vpd>|B<mprom>|B<firm>|B<cpu>|B<dimm>|B<all>}
B<rinv> I<noderange> [B<model>|B<serial>|B<deviceid>|B<uuid>|B<guid>|B<vpd>|B<mprom>|B<firm>|B<cpu>|B<dimm>|B<all>]
=head2 PPC (with HMC) specific:

View File

@ -876,6 +876,7 @@ sub rinv_response {
my $grep_string = $status_info{RINV_RESPONSE}{argv};
my $src;
my $content_info;
my @sorted_output;
foreach my $key_url (keys %{$response_info->{data}}) {
my %content = %{ ${ $response_info->{data} }{$key_url} };
@ -892,20 +893,24 @@ sub rinv_response {
next if ($grep_string eq "serial");
}
if (($grep_string eq "vpd" or $grep_string eq "mprom")) {
# wait for interface
if (($grep_string eq "vpd" or $grep_string eq "mprom") and $key_url =~ /\/motherboard$/) {
xCAT::SvrUtils::sendmsg("No mprom information is available", $callback, $node);
next if ($grep_string eq "mprom");
}
if (($grep_string eq "vpd" or $grep_string eq "deviceid")) {
# wait for interface
if (($grep_string eq "vpd" or $grep_string eq "deviceid") and $key_url =~ /\/motherboard$/) {
xCAT::SvrUtils::sendmsg("No deviceid information is available", $callback, $node);
next if ($grep_string eq "deviceid");
}
if ($grep_string eq "uuid") {
# wait for interface
xCAT::SvrUtils::sendmsg("No uuid information is available", $callback, $node);
last;
}
if ($grep_string eq "guid") {
# wait for interface
xCAT::SvrUtils::sendmsg("No guid information is available", $callback, $node);
last;
}
if ($grep_string eq "mac" and $key_url =~ /\/ethernet/) {
@ -923,10 +928,16 @@ sub rinv_response {
foreach my $key (keys %content) {
$content_info = uc ($src) . " " . $key . " : " . $content{$key};
xCAT::SvrUtils::sendmsg("$content_info", $callback, $node);
push (@sorted_output, $node . ": ". $content_info); #Save output in array
}
}
}
# If sorted array has any contents, sort it and print it
if (scalar @sorted_output > 0) {
@sorted_output = sort @sorted_output; #Sort all output
my $result = join "\n", @sorted_output; #Join into a single string for easier display
xCAT::SvrUtils::sendmsg("$result", $callback);
}
if ($next_status{ $node_info{$node}{cur_status} }) {
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };