From df1a5aeb522c0297a8c47a17b1caa6934b73904b Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 19 Jun 2017 10:32:30 -0400 Subject: [PATCH] Change to only display the active firmware instead of any firmware that is listed and add in the software id into the output so that sorting would keep the various software information together. --- xCAT-server/lib/xcat/plugins/openbmc.pm | 30 +++++++++++++++---------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 64bfbb99c..9bbed2852 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1036,25 +1036,31 @@ sub rinv_response { # Handle printing out all posssible Software values in a generic format: # node: Software: () # + my $sw_id = (split(/\//, $key_url))[-1]; if (defined($content{Version}) and $content{Version}) { my $purpose_value = uc ((split(/\./, $content{Purpose}))[-1]); my $activation_value = (split(/\./, $content{Activation}))[-1]; # - # The space below between "SOFTWARE:" and $content{Version} is intentional - # to cause the sorting of this line before any additional info lines + # For 'rinv firm', only print Active software. 'rflash list' will handle others # - $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); + if ($activation_value =~ "Active") { + # + # 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[$sw_id]: $content{Version} ($activation_value)"; + push (@sorted_output, $content_info); + + if (defined($content{ExtendedVersion}) and $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[$sw_id]: -- additional info: $ver"; + push (@sorted_output, $content_info); + } } + next; } - next; } } else { if (! defined $content{Present}) {