From d40660fc63cbfd0030ac190f44a349f3ff59473b Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 20 Oct 2017 11:58:23 -0400 Subject: [PATCH] Fix bug where the array is not being processed correctly in getting active firmware in openbmc code. --- xCAT-server/lib/xcat/plugins/openbmc.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 79dde842d..8339bec86 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1149,8 +1149,8 @@ sub get_functional_software_ids { # if (${ $response->{data} }{'/xyz/openbmc_project/software/functional'} ) { my %func_data = %{ ${ $response->{data} }{'/xyz/openbmc_project/software/functional'} }; - foreach my $fw_idx (keys %{ $func_data{endpoints} }) { - my $fw_id = (split(/\//, $func_data{endpoints}[$fw_idx]))[-1]; + foreach ( @{$func_data{endpoints}} ) { + my $fw_id = (split '/', $_)[-1]; $functional{$fw_id} = 1; } }