From c43feab7c4dca0157547f9c4b6acfbf6a63a1cf8 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 14 Sep 2009 12:51:51 +0000 Subject: [PATCH] -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 --- xCAT-server/lib/xcat/plugins/destiny.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index a26bbe40e..e6b3e3c0f 100644 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -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); }