mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
B #4793: Fix timestamp
This commit is contained in:
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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user