From 5c047d10733d6f2c1065ffc6495a6da3f4dea6ae Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 8 Feb 2012 18:37:48 +0000 Subject: [PATCH] fixed a bug for nodestatus git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11519 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 b9c6c42c1..d82e16586 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -1118,12 +1118,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+)//; + 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;