From 6de354571036b83ebd0403c54b600d98aefa2716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 13 Feb 2013 19:10:37 +0100 Subject: [PATCH] Feature #1739: Decode the host poll info string also in case of error --- src/im/InformationManagerDriver.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/im/InformationManagerDriver.cc b/src/im/InformationManagerDriver.cc index b984bc7c1b..47a0b20396 100644 --- a/src/im/InformationManagerDriver.cc +++ b/src/im/InformationManagerDriver.cc @@ -56,6 +56,9 @@ void InformationManagerDriver::protocol( set vm_ids; + string hinfo64; + string* hinfo; + // Parse the driver message if ( is.good() ) @@ -102,14 +105,16 @@ void InformationManagerDriver::protocol( vm_ids = host->get_running_vms(); + getline (is, hinfo64); + + hinfo = one_util::base64_decode(hinfo64); + if (result != "SUCCESS") { goto error_driver_info; } int rc; - string hinfo64; - string* hinfo; ostringstream oss; @@ -121,10 +126,6 @@ void InformationManagerDriver::protocol( vector vm_att; vector::iterator it; - getline (is, hinfo64); - - hinfo = one_util::base64_decode(hinfo64); - oss << "Host " << id << " successfully monitored."; NebulaLog::log("InM", Log::DEBUG, oss); @@ -267,7 +268,9 @@ void InformationManagerDriver::protocol( return; error_driver_info: - ess << "Error monitoring host " << id << " : " << is.str(); + ess << "Error monitoring host " << id << " : " << *hinfo; + + delete hinfo; for (set::iterator it = vm_ids.begin(); it != vm_ids.end(); it++) {