[icinga-checkins] icinga.org: icinga2/feature/ido: livestatus: time values must be integer seconds

git at icinga.org git at icinga.org
Mon Jul 15 09:26:14 CEST 2013


Module: icinga2
Branch: feature/ido
Commit: d6d61354eda9bee8e2fca1b1fad8f81c468c6a32
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=d6d61354eda9bee8e2fca1b1fad8f81c468c6a32

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Thu Jul 11 10:57:21 2013 +0200

livestatus: time values must be integer seconds

fixes #4406

---

 components/livestatus/commentstable.cpp  |    4 ++--
 components/livestatus/downtimestable.cpp |    6 +++---
 components/livestatus/hoststable.cpp     |    8 ++++----
 components/livestatus/servicestable.cpp  |    8 ++++----
 components/livestatus/statustable.cpp    |    2 +-
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/components/livestatus/commentstable.cpp b/components/livestatus/commentstable.cpp
index f551d18..088f926 100644
--- a/components/livestatus/commentstable.cpp
+++ b/components/livestatus/commentstable.cpp
@@ -117,7 +117,7 @@ Value CommentsTable::EntryTimeAccessor(const Value& row)
 	if (!comment)
 		return Value();
 
-	return comment->Get("entry_time");
+	return static_cast<int>(comment->Get("entry_time"));
 }
 
 Value CommentsTable::TypeAccessor(const Value& row)
@@ -175,5 +175,5 @@ Value CommentsTable::ExpireTimeAccessor(const Value& row)
 	if (!comment)
 		return Value();
 
-	return comment->Get("expire_time");
+	return static_cast<int>(comment->Get("expire_time"));
 }
diff --git a/components/livestatus/downtimestable.cpp b/components/livestatus/downtimestable.cpp
index 2222f64..880798d 100644
--- a/components/livestatus/downtimestable.cpp
+++ b/components/livestatus/downtimestable.cpp
@@ -105,7 +105,7 @@ Value DowntimesTable::EntryTimeAccessor(const Value& row)
 {
 	Dictionary::Ptr downtime = Service::GetDowntimeByID(row);
 
-	return downtime->Get("entry_time");
+	return static_cast<int>(downtime->Get("entry_time"));
 }
 
 Value DowntimesTable::TypeAccessor(const Value& row)
@@ -126,14 +126,14 @@ Value DowntimesTable::StartTimeAccessor(const Value& row)
 {
 	Dictionary::Ptr downtime = Service::GetDowntimeByID(row);
 
-	return downtime->Get("start_time");
+	return static_cast<int>(downtime->Get("start_time"));
 }
 
 Value DowntimesTable::EndTimeAccessor(const Value& row)
 {
 	Dictionary::Ptr downtime = Service::GetDowntimeByID(row);
 
-	return downtime->Get("end_time");
+	return static_cast<int>(downtime->Get("end_time"));
 }
 
 Value DowntimesTable::FixedAccessor(const Value& row)
diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp
index 0333362..a701924 100644
--- a/components/livestatus/hoststable.cpp
+++ b/components/livestatus/hoststable.cpp
@@ -509,7 +509,7 @@ Value HostsTable::NextCheckAccessor(const Value& row)
 	if (!hc)
 		return Value();
 
-	return hc->GetNextCheck();
+	return static_cast<int>(hc->GetNextCheck());
 }
 
 Value HostsTable::LastHardStateChangeAccessor(const Value& row)
@@ -520,7 +520,7 @@ Value HostsTable::LastHardStateChangeAccessor(const Value& row)
 	if (!hc)
 		return Value();
 
-	return hc->GetLastHardStateChange();
+	return static_cast<int>(hc->GetLastHardStateChange());
 }
 
 Value HostsTable::HasBeenCheckedAccessor(const Value& row)
@@ -617,12 +617,12 @@ Value HostsTable::LastCheckAccessor(const Value& row)
 	if (!hc)
 		return Value();
 
-	return hc->GetLastCheck();
+	return static_cast<int>(hc->GetLastCheck());
 }
 
 Value HostsTable::LastStateChangeAccessor(const Value& row)
 {
-	return static_cast<Host::Ptr>(row)->GetLastStateChange();
+	return static_cast<int>(static_cast<Host::Ptr>(row)->GetLastStateChange());
 }
 
 Value HostsTable::LastTimeUpAccessor(const Value& row)
diff --git a/components/livestatus/servicestable.cpp b/components/livestatus/servicestable.cpp
index afafcfc..c47788e 100644
--- a/components/livestatus/servicestable.cpp
+++ b/components/livestatus/servicestable.cpp
@@ -389,12 +389,12 @@ Value ServicesTable::LastTimeUnknownAccessor(const Value& row)
 
 Value ServicesTable::LastCheckAccessor(const Value& row)
 {
-	return static_cast<Service::Ptr>(row)->GetLastCheck();
+	return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastCheck());
 }
 
 Value ServicesTable::NextCheckAccessor(const Value& row)
 {
-	return static_cast<Service::Ptr>(row)->GetNextCheck();
+	return static_cast<int>(static_cast<Service::Ptr>(row)->GetNextCheck());
 }
 
 Value ServicesTable::LastNotificationAccessor(const Value& row)
@@ -417,12 +417,12 @@ Value ServicesTable::CurrentNotificationNumberAccessor(const Value& row)
 
 Value ServicesTable::LastStateChangeAccessor(const Value& row)
 {
-	return static_cast<Service::Ptr>(row)->GetLastStateChange();
+	return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastStateChange());
 }
 
 Value ServicesTable::LastHardStateChangeAccessor(const Value& row)
 {
-	return static_cast<Service::Ptr>(row)->GetLastHardStateChange();
+	return static_cast<int>(static_cast<Service::Ptr>(row)->GetLastHardStateChange());
 }
 
 Value ServicesTable::ScheduledDowntimeDepthAccessor(const Value& row)
diff --git a/components/livestatus/statustable.cpp b/components/livestatus/statustable.cpp
index ff4dc45..65e6dd1 100644
--- a/components/livestatus/statustable.cpp
+++ b/components/livestatus/statustable.cpp
@@ -312,7 +312,7 @@ Value StatusTable::CheckExternalCommandsAccessor(const Value& row)
 
 Value StatusTable::ProgramStartAccessor(const Value& row)
 {
-	return IcingaApplication::GetInstance()->GetStartTime();
+	return static_cast<int>(IcingaApplication::GetInstance()->GetStartTime());
 }
 
 Value StatusTable::LastCommandCheckAccessor(const Value& row)





More information about the icinga-checkins mailing list