From 9499068da5298dd5d6bbb0e0f1bafdb4d8e22587 Mon Sep 17 00:00:00 2001 From: sjing Date: Mon, 26 Jul 2010 09:03:23 +0000 Subject: [PATCH] Give error message if invalid osimage is provided to rmnimimage. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6855 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index fb70306a5..cb9080105 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -3984,6 +3984,22 @@ sub prermnimimage return (1); } + # + # get list of defined xCAT osimage objects + # + my @deflist = undef; + @deflist = xCAT::DBobjUtils->getObjectsOfType("osimage"); + + # check if the provided image is valid. + # + if (!grep(/^$image_name$/, @deflist)) + { + my $rsp; + push @{$rsp->{data}}, "\'$image_name\' is not a valid xCAT image name.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return (1); + } + # get the xCAT image definition my %objtype; $objtype{$image_name} = 'osimage';