-Check supportedarchs at nodeset time if netboot= or install= nodeset argument is requested

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4126 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-09-14 12:51:51 +00:00
parent e0ee3d3a0b
commit c43feab7c4

View File

@ -131,14 +131,21 @@ sub setdestiny {
}
if ($target) {
my $updateattribs;
my $nodetypetable = xCAT::Table->new('nodetype',-create=>1);
my $archentries = $nodetypetable->getNodesAttribs($req->{node},['supportedarchs']);
if ($target =~ /(.*)-(.*)-(.*)/) {
$updateattribs->{os}=$1;
$updateattribs->{arch}=$2;
$updateattribs->{profile}=$3;
foreach (@{$req->{node}}) {
if ($archentries->{$_}->[0]->{supportedarchs} and $archentries->{$_}->[0]->{supportedarchs} !~ /(^|,)$2(\z|,)/) {
$callback->({errorcode=>1,error=>"Requested architecture ".$updateattribs->{arch}." is not one of the architectures supported by $_ (per nodetype.supportedarchs, it supports ".$archentries->{$_}->[0]->{supportedarchs}.")"});
return;
}
}
} else {
$updateattribs->{profile}=$target;
}
my $nodetypetable = xCAT::Table->new('nodetype',-create=>1);
$nodetypetable->setNodesAttribs($req->{node},$updateattribs);
}