Fix that triggered_by field is not of type int in a livestatus response

fixes #5356
This commit is contained in:
Johannes Meyer 2013-12-17 15:15:39 +01:00
parent 9bf44b9b1d
commit 772f319926
3 changed files with 7 additions and 1 deletions

View File

@ -152,5 +152,5 @@ Value DowntimesTable::TriggeredByAccessor(const Value& row)
{ {
Downtime::Ptr downtime = static_cast<Downtime::Ptr>(row); Downtime::Ptr downtime = static_cast<Downtime::Ptr>(row);
return downtime->GetTriggeredBy(); return downtime->GetTriggeredByLegacyId();
} }

View File

@ -12,6 +12,7 @@ class Downtime
[state] double trigger_time; [state] double trigger_time;
[state] bool fixed; [state] bool fixed;
[state] double duration; [state] double duration;
[state] int triggered_by_legacy_id;
[state] String triggered_by; [state] String triggered_by;
[state] String scheduled_by; [state] String scheduled_by;
[state] Dictionary::Ptr triggers { [state] Dictionary::Ptr triggers {

View File

@ -70,6 +70,11 @@ String Service::AddDowntime(const String& author, const String& comment,
downtime->SetTriggeredBy(triggeredBy); downtime->SetTriggeredBy(triggeredBy);
downtime->SetScheduledBy(scheduledBy); downtime->SetScheduledBy(scheduledBy);
if (!triggeredBy.IsEmpty()) {
Downtime::Ptr triggerDowntime = GetDowntimeByID(triggeredBy);
downtime->SetTriggeredByLegacyId(triggerDowntime->GetLegacyId());
}
int legacy_id; int legacy_id;
{ {