B #4793: Fix timestamp

This commit is contained in:
Ruben S. Montero authored and GitHub committed 2020-05-27 10:25:10 +02:00
commit 648fe67f15
2 files changed
+6 -5

No files matched your search

@@ -317,7 +317,10 @@ void HostMonitorManager::monitor_vm(int oid,
VirtualMachineMonitorInfo monitoring(oid, time(nullptr));
//Get previous monitor info to merge with new data
vmpool->get_monitoring(oid, monitoring);
if (vmpool->get_monitoring(oid, monitoring))
{
monitoring.timestamp(time(nullptr));
}
if (monitoring.from_template(tmpl) != 0)
{
+2 -4
View File
@@ -71,14 +71,12 @@ int VirtualMachineMonitorInfo::from_xml(const std::string& xml_string)
{
int rc = monitoring.from_xml(xml_string);
if (rc < 0)
if (rc < 0 || !monitoring.get("TIMESTAMP", _timestamp)
|| !monitoring.get("ID", _oid))
{
return -1;
}
return monitoring.get("TIMESTAMP", _timestamp) &&
monitoring.get("ID", _oid);
return 0;
}