-Have makeconservercf report error when config is bad instead of writing malformed conserver config files

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4238 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-09-26 18:16:26 +00:00
parent 20bbf94bea
commit e954e4c684

View File

@ -309,7 +309,10 @@ sub makeconservercf {
dotsent($_,\@filecontent);
$termservers{$_->{termserver}}=1; #prevent needless cycles being burned
}
donodeent($_,\@filecontent,$delmode);
if (donodeent($_,\@filecontent,$delmode) eq "BADCFG") {
$cb->({node=>[{name=>$node,error=>"Bad configuration, check attributes under the nodehm category",errorcode=>1}]});
}
}
}
}
@ -338,7 +341,9 @@ sub makeconservercf {
$termservers{$_->{termserver}}=1; #prevent needless cycles being burned
}
if ( $type{$_->{node}} !~ /fsp|bpa|hmc|ivm/ ) {
donodeent($_,\@filecontent);
if (donodeent($_,\@filecontent) eq "BADCFG") {
$cb->({node=>[{name=>$_,error=>"Bad configuration, check attributes under the nodehm category",errorcode=>1}]});
}
}
}
}
@ -440,10 +445,13 @@ sub donodeent {
if ($delmode) {
return;
}
my $cmeth=$cfgent->{cons};
if (not $cmeth or (grep(/^$cmeth$/,@cservers) and (not $cfgent->{termserver} or not $cfgent->{termport}))) {
return "BADCFG";
}
push @$content,"#xCAT BEGIN $node CONS\n";
push @$content,"console $node {\n";
#if ($cfgent->{cons}
my $cmeth=$cfgent->{cons};
#print $cmeth."\n";
if (grep(/^$cmeth$/,@cservers)) {
push @$content," include ".$cfgent->{termserver}.";\n";