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
This commit is contained in:
sjing 2010-07-26 09:03:23 +00:00
parent ecac9ad26c
commit 9499068da5

View File

@ -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';