-Fix setNodesAttribs syntax problem

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4891 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2010-01-05 15:23:42 +00:00
parent 8ff1b83d07
commit 3ff2c0eaaa

View File

@ -1643,7 +1643,11 @@ sub setNodesAttribs {
foreach my $col (@orderedcols) { #try aggregating requests. Could also see about single prepare, multiple executes instead
$upstring .= "$col = ?, ";
}
$upstring =~ s/, / where $nodekey = ?/;
if (grep { $_ eq $nodekey } @orderedcols) {
$upstring =~ s/, \z//;
} else {
$upstring =~ s/, \z/ where $nodekey = ?/;
}
$upsth = $self->{dbh}->prepare($upstring);
}
if (scalar keys %updatenodes) {