From 8392a75e940468270f2e1b05da084ac00ad42f7b Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 8 Feb 2012 18:32:16 +0000 Subject: [PATCH] fixed a bug for nodestatus git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.6@11518 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/nodestat.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index 3d541de5a..b4921a085 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -1111,12 +1111,16 @@ sub process_request { while ($newappstatus =~ /(\w+)\=(\w+)/) { my $tmp1=$1; my $tmp2=$2; - if($oldappstatus =~ /$tmp1\=/){ - $oldappstatus =~ s/$tmp1\=\w+/$tmp1\=$tmp2/g; - }else{ - $oldappstatus = $oldappstatus."\,$tmp1\=$tmp2"; - } - $newappstatus =~ s/(\w+)\=(\w+)//g; + if ($oldappstatus) { + if($oldappstatus =~ /$tmp1\=/){ + $oldappstatus =~ s/$tmp1\=\w+/$tmp1\=$tmp2/g; + }else{ + $oldappstatus = $oldappstatus."\,$tmp1\=$tmp2"; + } + } else { + $oldappstatus = "$tmp1\=$tmp2"; + } + $newappstatus =~ s/(\w+)\=(\w+)//; } $status1->{$node1}->{appstatus}= $oldappstatus; $status1->{$node1}->{appstatustime}= $currtime;