2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 01:26:38 +00:00

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
This commit is contained in:
Victor Hu 2017-05-26 10:57:48 -04:00
parent 9bd0054d10
commit af3a07a367

View File

@ -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: <Purpose> Software: <version> (<Activation>)
#
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;
}
}