From 17d6cd35d04cf1a2e06eda0584998c625ec5dbb6 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 20 Jun 2016 15:31:39 -0400 Subject: [PATCH] Correct the count of removed objects --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 40285f360..5e0f04abb 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -3818,6 +3818,7 @@ sub defrm # the memberlist nodes must be updated. my $numobjects = 0; + my $numobjects_not_removed = 0; my %objTypeLists; foreach my $obj (keys %objhash) { @@ -3831,6 +3832,7 @@ sub defrm my $rsp; $rsp->{data}->[0] = "Could not find an object named \'$obj\' of type \'$objtype\'."; xCAT::MsgUtils->message("E", $rsp, $::callback); + $numobjects_not_removed++; next; } $numobjects++; @@ -3848,6 +3850,7 @@ sub defrm my $rsp; $rsp->{data}->[0] = "Could not get xCAT object definition for \'$obj\'."; xCAT::MsgUtils->message("I", $rsp, $::callback); + $numobjects_not_removed++; next; } @@ -3887,6 +3890,7 @@ sub defrm my $m = join ',', @nodes; $rsp->{data}->[0] = "Could not get xCAT object definition for \'$m\'."; xCAT::MsgUtils->message("I", $rsp, $::callback); + $numobjects_not_removed++; next; } @@ -3985,7 +3989,7 @@ sub defrm else { my $rsp; - my $nodenum = scalar(keys %objhash); + my $nodenum = scalar(keys %objhash) - $numobjects_not_removed; $rsp->{data}->[0] = "$nodenum object definitions have been removed."; xCAT::MsgUtils->message("I", $rsp, $::callback); }