From af3a07a367b69bfa081bc861ce8af7701c496a47 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 10:57:48 -0400 Subject: [PATCH 01/11] Change the output of the rinv firm option to handle all possible return values from the API in a generic string. This allows for the code to support any string without additional effort to create custom messages --- xCAT-server/lib/xcat/plugins/openbmc.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 84d9226a6..a65b49f9f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -935,9 +935,17 @@ sub rinv_response { my %content = %{ ${ $response_info->{data} }{$key_url} }; if ($grep_string eq "firm") { + # This handles the data from the /xyz/openbmc_project/Software endpoint. + # + # Handle printing out all posssible Software values in a generic format: + # node: Software: () + # if (defined($content{Version}) and $content{Version}) { - my $firm_ver = "System Firmware Product Version: " . "$content{Version}"; - xCAT::SvrUtils::sendmsg("$firm_ver", $callback, $node); + # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. + my $purpose_value = (split(/\./, $content{Purpose}))[-1]; + my $activation_value = (split(/\./, $content{Activation}))[-1]; + my $software_str = "$purpose_value Software: $content{Version} (Activation=$activation_value)"; + xCAT::SvrUtils::sendmsg("$software_str", $callback, $node); next; } } From 6c6123ab84fe0029f1cbccda7a669df109e544e5 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 14:17:16 -0400 Subject: [PATCH 02/11] Fix spacing in sub rinv_response() --- xCAT-server/lib/xcat/plugins/openbmc.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index a65b49f9f..e820ba2f5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -922,10 +922,10 @@ sub rinv_response { my $grep_string; if ($node_info{$node}{cur_status} eq "RINV_FIRM_RESPONSE") { - $grep_string = "firm"; - } else { - $grep_string = $status_info{RINV_RESPONSE}{argv}; - } + $grep_string = "firm"; + } else { + $grep_string = $status_info{RINV_RESPONSE}{argv}; + } my $src; my $content_info; @@ -1000,13 +1000,13 @@ sub rinv_response { 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 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} }; From 03b7e1fb6b9ab90b1ad5d1bc8a91c545d84ead30 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 15:46:49 -0400 Subject: [PATCH 03/11] Check if the item is present on the server, if not, there's no reason to print out the data. Fixed the sorting to be alpha, then numeric. --- xCAT-server/lib/xcat/plugins/openbmc.pm | 29 +++++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index e820ba2f5..70f8b857e 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -942,14 +942,27 @@ sub rinv_response { # if (defined($content{Version}) and $content{Version}) { # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. - my $purpose_value = (split(/\./, $content{Purpose}))[-1]; + my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); my $activation_value = (split(/\./, $content{Activation}))[-1]; - my $software_str = "$purpose_value Software: $content{Version} (Activation=$activation_value)"; - xCAT::SvrUtils::sendmsg("$software_str", $callback, $node); + my $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; + xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); next; } } + if (! defined $content{Present}) { + # This should never happen, but if we find this, contact firmware team to fix... + xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); + next; + } + + # If the item is not found on the server, do not bother printing it out + if ($content{Present} eq 0) { next; } + + # + # Need to re-visit this code, commenting out for now... + # +=for comment if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); @@ -987,6 +1000,7 @@ sub rinv_response { xCAT::SvrUtils::sendmsg("$macaddress", $callback, $node); next; } +=cut if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) { if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { @@ -997,15 +1011,16 @@ sub rinv_response { foreach my $key (keys %content) { $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $node . ": ". $content_info); #Save output in array + push (@sorted_output, $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); + # sort alpha, then numeric + my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort + grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; + xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); } if ($next_status{ $node_info{$node}{cur_status} }) { From 9a457fe2d70fd7cb66b79306ad663235ef2db9ff Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 21:27:15 -0400 Subject: [PATCH 04/11] For now, let's continue printing out all the values --- xCAT-server/lib/xcat/plugins/openbmc.pm | 3 --- 1 file changed, 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 70f8b857e..1cb9af5d3 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -956,9 +956,6 @@ sub rinv_response { next; } - # If the item is not found on the server, do not bother printing it out - if ($content{Present} eq 0) { next; } - # # Need to re-visit this code, commenting out for now... # From 33371667cb3482b64a15260d5926adbb66d7dd5e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:42:23 -0400 Subject: [PATCH 05/11] Remove options that are not supported for rinv --- .../admin-guides/references/man1/rinv.1.rst | 18 +++++++++--------- perl-xCAT/xCAT/Usage.pm | 6 +++--- xCAT-client/pods/man1/rinv.1.pod | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index df454d284..3cc89c839 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -28,18 +28,18 @@ BMC/MPA specific: \ **rinv**\ \ *noderange*\ {\ **pci | model | serial | asset | vpd | mprom | deviceid | guid | firm | diag | dimm | bios | mparom | mac | all**\ } -OpenPOWER (using ipmi) server specific: -======================================= +OpenPOWER (IPMI) server specific: +================================= \ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ ] -OpenPOWER (using openbmc) server specific: -========================================== +OpenPOWER (OpenBMC) server specific: +==================================== -\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ ] +\ **rinv**\ \ *noderange*\ [\ **model | serial | mprom | firm | cpu | dimm | all**\ ] PPC (with HMC) specific: @@ -195,25 +195,25 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo \ **mprom**\ - Retrieves mprom firmware level + Retrieves mprom firmware level. \ **deviceid**\ - Retrieves device identification. Usually device, manufacturing and product ids. + Retrieves device identification. Usually device, manufacturing and product IDs. \ **uuid**\ - Retrieves the universally unique identifier + Retrieves the universally unique identifier. \ **guid**\ - Retrieves the global unique identifier + Retrieves the global unique identifier . diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 742f7a9a1..ff3e3ca69 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -97,10 +97,10 @@ my %usage = ( rinv [-h|--help|-v|--version] BMC specific: rinv [mprom|deviceid|uuid|guid|vpd|dimm|all] - OpenPOWER (using ipmi) server specific: + OpenPOWER (IPMI) server specific: rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all] - OpenPOWER (using openbmc) server specific: - rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|cpu|dimm|all] + OpenPOWER (OpenBMC) server specific: + rinv [model|serial|firm|cpu|dimm|all] MPA specific: rinv [firm|bios|diag|mprom|sprom|mparom|mac|mtm] PPC specific(with HMC): diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 3a5c92f29..b08b15279 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -10,13 +10,13 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] B I {B|B|B|B|B|B|B|B|B|B|B|B|B|B|B} -=head2 OpenPOWER (using ipmi) server specific: +=head2 OpenPOWER (IPMI) server specific: B I [B|B|B|B|B|B|B|B|B] -=head2 OpenPOWER (using openbmc) server specific: +=head2 OpenPOWER (OpenBMC) server specific: -B I [B|B|B|B|B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B] =head2 PPC (with HMC) specific: @@ -125,19 +125,19 @@ Diagnostics information of firmware. =item B -Retrieves mprom firmware level +Retrieves mprom firmware level. =item B -Retrieves device identification. Usually device, manufacturing and product ids. +Retrieves device identification. Usually device, manufacturing and product IDs. =item B -Retrieves the universally unique identifier +Retrieves the universally unique identifier. =item B -Retrieves the global unique identifier +Retrieves the global unique identifier . =item B From 09ae91a31ae4c4be5b89ca8657b94d5ad867af50 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:43:11 -0400 Subject: [PATCH 06/11] Generically support the options for OpenBMC and not look for specific fields to print --- xCAT-server/lib/xcat/plugins/openbmc.pm | 66 +++++-------------------- 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 1cb9af5d3..adb21c58e 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -408,7 +408,7 @@ sub parse_args { } } elsif ($command eq "rinv") { $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^cpu$|^dimm$|^model$|^serial$|^firm$|^mac$|^vpd$|^mprom$|^deviceid$|^guid$|^uuid$|^all$/) { + unless ($subcommand =~ /^model$|^serial$|^firm$|^cpu$|^dimm$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "getopenbmccons") { @@ -956,60 +956,20 @@ sub rinv_response { next; } - # - # Need to re-visit this code, commenting out for now... - # -=for comment - if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { - my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; - xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); - next if ($grep_string eq "model"); - } + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { + $src = "$1 $2"; + } else { + $src = basename $key_url; + } - if (($grep_string eq "vpd" or $grep_string eq "serial") and $key_url =~ /\/motherboard$/) { - my $serialnumber = "BOARD Serial Number: " . "$content{SerialNumber}"; - xCAT::SvrUtils::sendmsg("$serialnumber", $callback, $node); - next if ($grep_string eq "serial"); - } - - 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") 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") { - xCAT::SvrUtils::sendmsg("No uuid information is available", $callback, $node); - last; - } - - if ($grep_string eq "guid") { - xCAT::SvrUtils::sendmsg("No guid information is available", $callback, $node); - last; - } - - if ($grep_string eq "mac" and $key_url =~ /\/ethernet/) { - my $macaddress = "MAC: " . $content{MACAddress}; - xCAT::SvrUtils::sendmsg("$macaddress", $callback, $node); - next; - } -=cut - - if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) { - if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { - $src = "$1 $2"; - } else { - $src = basename $key_url; - } - - foreach my $key (keys %content) { - $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $content_info); #Save output in array + foreach my $key (keys %content) { + # If not all options is specified, check whether the key string contains + # the keyword option. If so, add it to the return data + if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + next; } + $content_info = uc ($src) . " " . $key . " : " . $content{$key}; + push (@sorted_output, $content_info); #Save output in array } } # If sorted array has any contents, sort it and print it From 85bcbea210dd884d1253d19a14c6766b834befb1 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 22:46:12 -0400 Subject: [PATCH 07/11] If no values are in the return array, print a message --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index adb21c58e..bd1b5e917 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -978,6 +978,8 @@ sub rinv_response { my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); + } else { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); } if ($next_status{ $node_info{$node}{cur_status} }) { From eb9487b0b9de4a42a2e9be4f1d97512d3471e4bb Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 2 Jun 2017 14:24:51 -0400 Subject: [PATCH 08/11] Handle the firmware data using the same sorted output array and add in support for ExtendedVersion --- xCAT-server/lib/xcat/plugins/openbmc.pm | 58 +++++++++++++++---------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index bd1b5e917..276d5f470 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -941,35 +941,47 @@ sub rinv_response { # node: Software: () # if (defined($content{Version}) and $content{Version}) { - # TODO: In future, if we want to support ExtendedVersion, we should enable Verbose output. my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); my $activation_value = (split(/\./, $content{Activation}))[-1]; - my $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; - xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); + # + # The space below between "SOFTWARE:" and $content{Version} is intentional + # to cause the sorting of this line before any additional info lines + # + $content_info = "$purpose_value SOFTWARE: $content{Version} ($activation_value)"; + push (@sorted_output, $content_info); + + if ($content{ExtendedVersion} ne "") { + # ExtendedVersion is going to be a comma separated list of additional software + my @versions = split(',', $content{ExtendedVersion}); + foreach my $ver (@versions) { + $content_info = "$purpose_value SOFTWARE: -- additional info: $ver"; + push (@sorted_output, $content_info); + } + } next; } - } - - if (! defined $content{Present}) { - # This should never happen, but if we find this, contact firmware team to fix... - xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); - next; - } - - if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { - $src = "$1 $2"; } else { - $src = basename $key_url; - } - - foreach my $key (keys %content) { - # If not all options is specified, check whether the key string contains - # the keyword option. If so, add it to the return data - if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { - next; + if (! defined $content{Present}) { + # This should never happen, but if we find this, contact firmware team to fix... + xCAT::SvrUtils::sendmsg("ERROR: Invalid data for $key_url, contact firmware team!", $callback, $node); + next; + } + + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { + $src = "$1 $2"; + } else { + $src = basename $key_url; + } + + foreach my $key (keys %content) { + # If not all options is specified, check whether the key string contains + # the keyword option. If so, add it to the return data + if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + next; + } + $content_info = uc ($src) . " " . $key . " : " . $content{$key}; + push (@sorted_output, $content_info); #Save output in array } - $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - push (@sorted_output, $content_info); #Save output in array } } # If sorted array has any contents, sort it and print it From 9340c2d2e4ae032027931b111b780ee1498eafc0 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 2 Jun 2017 14:52:53 -0400 Subject: [PATCH 09/11] Fixes the test so that rinv options will check both key and key_url --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 276d5f470..45a9395e2 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -976,7 +976,7 @@ sub rinv_response { foreach my $key (keys %content) { # If not all options is specified, check whether the key string contains # the keyword option. If so, add it to the return data - if ($grep_string ne "all" and lc($key) !~ m/$grep_string/i ) { + if ($grep_string ne "all" and ((lc($key) !~ m/$grep_string/i) and ($key_url !~ m/$grep_string/i)) ) { next; } $content_info = uc ($src) . " " . $key . " : " . $content{$key}; From b888c12291dc1f7374cebbe7ad4fbb3db74bd99e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 9 Jun 2017 08:00:30 -0400 Subject: [PATCH 10/11] Remove mprom from the man page for rinv --- docs/source/guides/admin-guides/references/man1/rinv.1.rst | 2 +- xCAT-client/pods/man1/rinv.1.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index 3cc89c839..0a1c944d5 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -39,7 +39,7 @@ OpenPOWER (OpenBMC) server specific: ==================================== -\ **rinv**\ \ *noderange*\ [\ **model | serial | mprom | firm | cpu | dimm | all**\ ] +\ **rinv**\ \ *noderange*\ [\ **model | serial | firm | cpu | dimm | all**\ ] PPC (with HMC) specific: diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index b08b15279..b680c0c7e 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -16,7 +16,7 @@ B I [B|B|B|B|B|B|B I [B|B|B|B|B|B|B] +B I [B|B|B|B|B|B] =head2 PPC (with HMC) specific: From 9de8c1aad1819c41c1e5344224bfe71665bdf031 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 16 Jun 2017 10:49:29 -0400 Subject: [PATCH 11/11] For serial and model options, only return the system level information --- xCAT-server/lib/xcat/plugins/openbmc.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 45a9395e2..906751c1f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -967,6 +967,13 @@ sub rinv_response { next; } + # SPECIAL CASE: If 'serial' or 'model' is specified, only return the system level information + if ($grep_string eq "serial" or $grep_string eq "model") { + if ($key_url ne "$openbmc_project_url/inventory/system") { + next; + } + } + if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { $src = "$1 $2"; } else {