]> granicus.if.org Git - icinga2/commitdiff
Fix missing IDO updates for groups
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 24 Aug 2016 09:35:12 +0000 (11:35 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 24 Aug 2016 10:22:09 +0000 (12:22 +0200)
fixes #12527

lib/db_ido/hostdbobject.cpp
lib/db_ido/servicedbobject.cpp
lib/db_ido/userdbobject.cpp
lib/db_ido/userdbobject.hpp

index 7292338acd0d7ccff3a36f3f8c2312fe39e4d6ea..30ef27a3076cf16f7ace0a8a5b6f78be9ca90038 100644 (file)
@@ -397,6 +397,11 @@ String HostDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) co
 
        Host::Ptr host = static_pointer_cast<Host>(GetObject());
 
+       Array::Ptr groups = host->GetGroups();
+
+       if (groups)
+               hashData += DbObject::HashValue(groups);
+
        Array::Ptr parents = new Array();
 
        /* parents */
index 921e159609ddf6df0080bb897c08dfc82aa03655..b9009097f694b892177dcacab26ec8cef2e2cf7b 100644 (file)
@@ -357,6 +357,11 @@ String ServiceDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields)
 
        Service::Ptr service = static_pointer_cast<Service>(GetObject());
 
+       Array::Ptr groups = service->GetGroups();
+
+       if (groups)
+               hashData += DbObject::HashValue(groups);
+
        Array::Ptr dependencies = new Array();
 
        /* dependencies */
index 60fe460e647746d1ded7a1af9cf51692888fd1c0..c50a78e7154c47e316898ef8460436824b3d076b 100644 (file)
@@ -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<User>(GetObject());
+
+       Array::Ptr groups = user->GetGroups();
+
+       if (groups)
+               hashData += DbObject::HashValue(groups);
+
+       return hashData;
+}
index 20f18fa213c44c763e83194d769be6618e225998..2aa90be4856d876983b23a723d588fa3da734415 100644 (file)
@@ -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;
 };
 
 }