From f0bfce5aa95db934bfa702f637e0be4b2d369d2d Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 5 Oct 2017 16:42:35 -0400 Subject: [PATCH] Adding quick change to protect from user specifying multiple firmware images to activate/delete --- xCAT-server/lib/xcat/plugins/openbmc.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 87153fcd7..4c74e1316 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -912,6 +912,7 @@ sub parse_command_status { my $upload = 0; my $activate = 0; my $update_file; + my @flash_arguments; foreach $subcommand (@$subcommands) { if ($subcommand =~ /-c|--check/) { @@ -926,9 +927,17 @@ sub parse_command_status { $activate = 1; } else { $update_file = $subcommand; + push (@flash_arguments, $subcommand); } } + if (scalar @flash_arguments > 1) { + my $flag = ""; + if ($delete) { $flag = "to delete"; } + if ($activate) { $flag = "to activate"; } + xCAT::SvrUtils::sendmsg([1, "More than one firmware specified $flag is currently not supported."], $callback); + return 1; + } my $file_id = undef; my $grep_cmd = "/usr/bin/grep -a"; my $version_tag = '"^version="';