From b238df3fa3d58a9bc0a5729056adc074268622a4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 24 Aug 2016 11:35:12 +0200 Subject: [PATCH] Fix missing IDO updates for groups fixes #12527 --- lib/db_ido/hostdbobject.cpp | 5 +++++ lib/db_ido/servicedbobject.cpp | 5 +++++ lib/db_ido/userdbobject.cpp | 14 ++++++++++++++ lib/db_ido/userdbobject.hpp | 2 ++ 4 files changed, 26 insertions(+) diff --git a/lib/db_ido/hostdbobject.cpp b/lib/db_ido/hostdbobject.cpp index 7292338ac..30ef27a30 100644 --- a/lib/db_ido/hostdbobject.cpp +++ b/lib/db_ido/hostdbobject.cpp @@ -397,6 +397,11 @@ String HostDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) co Host::Ptr host = static_pointer_cast(GetObject()); + Array::Ptr groups = host->GetGroups(); + + if (groups) + hashData += DbObject::HashValue(groups); + Array::Ptr parents = new Array(); /* parents */ diff --git a/lib/db_ido/servicedbobject.cpp b/lib/db_ido/servicedbobject.cpp index 921e15960..b9009097f 100644 --- a/lib/db_ido/servicedbobject.cpp +++ b/lib/db_ido/servicedbobject.cpp @@ -357,6 +357,11 @@ String ServiceDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) Service::Ptr service = static_pointer_cast(GetObject()); + Array::Ptr groups = service->GetGroups(); + + if (groups) + hashData += DbObject::HashValue(groups); + Array::Ptr dependencies = new Array(); /* dependencies */ diff --git a/lib/db_ido/userdbobject.cpp b/lib/db_ido/userdbobject.cpp index 60fe460e6..c50a78e71 100644 --- a/lib/db_ido/userdbobject.cpp +++ b/lib/db_ido/userdbobject.cpp @@ -163,3 +163,17 @@ void UserDbObject::OnConfigUpdateHeavy(void) DbObject::OnMultipleQueries(queries); } + +String UserDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) const +{ + String hashData = DbObject::CalculateConfigHash(configFields); + + User::Ptr user = static_pointer_cast(GetObject()); + + Array::Ptr groups = user->GetGroups(); + + if (groups) + hashData += DbObject::HashValue(groups); + + return hashData; +} diff --git a/lib/db_ido/userdbobject.hpp b/lib/db_ido/userdbobject.hpp index 20f18fa21..2aa90be48 100644 --- a/lib/db_ido/userdbobject.hpp +++ b/lib/db_ido/userdbobject.hpp @@ -43,6 +43,8 @@ protected: virtual Dictionary::Ptr GetStatusFields(void) const override; virtual void OnConfigUpdateHeavy(void) override; + + virtual String CalculateConfigHash(const Dictionary::Ptr& configFields) const; }; }