From f19883d909815aa41dc639408ed863600e418b17 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 1 Nov 2012 08:43:14 +0000 Subject: [PATCH] Rewrite TableUtils->setUpdateStatus no Where clause , use setNodesAttribs instead git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14195 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/TableUtils.pm | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/perl-xCAT/xCAT/TableUtils.pm b/perl-xCAT/xCAT/TableUtils.pm index 71c8b010e..14b056667 100644 --- a/perl-xCAT/xCAT/TableUtils.pm +++ b/perl-xCAT/xCAT/TableUtils.pm @@ -901,18 +901,14 @@ sub setUpdateStatus if(@nodes>0){ my %updates; - $updates{'updatestatus'} = $status; - $updates{'updatestatustime'} = $currtime; - my $where_clause; - my $dbname=xCAT::Utils->get_DBName() ; - if ($dbname eq 'DB2') { - $where_clause="\"node\" in ('" . join("','", @nodes) . "')"; - } else { - $where_clause="node in ('" . join("','", @nodes) . "')"; - } - # print "$where_clause"; - $nltab->setAttribsWhere($where_clause, \%updates ); - } + foreach my $node (@nodes) + { + $updates{$node}{'updatestatus'} = $status; + $updates{$node}{'updatestatustime'} = $currtime; + } + + $nltab->setNodesAttribs(\%updates); + } $nltab->close; } return;