Skip to content

Conversation

raviks789
Copy link
Collaborator

fixes #2876

@raviks789 raviks789 added this to the v1.12.0 milestone Aug 1, 2025
@raviks789 raviks789 requested a review from nilmerg August 1, 2025 14:36
@raviks789 raviks789 self-assigned this Aug 1, 2025
@cla-bot cla-bot bot added the cla/signed label Aug 1, 2025
@slalomsk8er
Copy link

Does this relate to icingacli director hostgroups refreshMembers provides by:

diff --git a/application/clicommands/HostgroupsCommand.php b/application/clicommands/HostgroupsCommand.php
index 1007a05a..bfcfbe3c 100644
--- a/application/clicommands/HostgroupsCommand.php
+++ b/application/clicommands/HostgroupsCommand.php
@@ -3,6 +3,8 @@
 namespace Icinga\Module\Director\Clicommands;

 use Icinga\Module\Director\Cli\ObjectsCommand;
+use Icinga\Module\Director\Objects\HostGroupMembershipResolver;
+use ReflectionClass;

 /**
  * Manage Icinga Hostgroups
@@ -11,4 +13,11 @@ use Icinga\Module\Director\Cli\ObjectsCommand;
  */
 class HostgroupsCommand extends ObjectsCommand
 {
+    public function refreshMembersAction()
+    {
+        $resolver = new HostGroupMembershipResolver($this->db());
+        $reflection = new ReflectionClass($resolver);
+        $reflection->getMethod('getObjects')->invoke($resolver);
+        $resolver->refreshDb(true);
+    }
 }

in any way?

Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Users with Director restrictions unable to create hosts unless you manually specify the host group

3 participants