From 3ff2c0eaaa3822ab01d9379b48bb7851163952b7 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 5 Jan 2010 15:23:42 +0000 Subject: [PATCH] -Fix setNodesAttribs syntax problem git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4891 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Table.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 6591bfaf9..6be0ea5fe 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -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) {