From af3a07a367b69bfa081bc861ce8af7701c496a47 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 10:57:48 -0400 Subject: [PATCH] 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; } }