]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Fixing lib/ansible/ds389_plugins_info.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 2 Jan 2025 13:57:42 +0000 (14:57 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 2 Jan 2025 13:57:42 +0000 (14:57 +0100)
lib/ansible/ds389_plugins_info.py

index a6d3df5615a6bd7117fb5c27b3fa4c3294d7abdc..bcc7d64e66a8564aeaa4e29f8488ecf87cc0c6ff 100644 (file)
@@ -124,7 +124,7 @@ class Ds389PluginsInfo(object):
     def get_automember(self):
         """Get configuration, definitions and regular expressions of the automember plugnin."""
         proc = run(
-            [self.cmd, self.instance, 'plugin', 'show'],
+            [self.cmd, self.instance, 'plugin', 'automember', 'show'],
             capture_output=True, encoding=self.encoding)
         if proc.stderr:
             module.warn(proc.stderr)
@@ -171,7 +171,7 @@ class Ds389PluginsInfo(object):
     def _get_automember_definitions(self):
 
         proc = run(
-            [self.cmd, self.instance, 'plugin', 'list', 'definitions'],
+            [self.cmd, self.instance, 'plugin', 'automember', 'list', 'definitions'],
             capture_output=True, encoding=self.encoding)
         if proc.stderr:
             module.warn(proc.stderr)
@@ -179,12 +179,17 @@ class Ds389PluginsInfo(object):
             return
 
         key = 'automember'
+        re_no_automember = re.compile(
+            r'^No\s+Automember\s+definitions\s+were\s+found', re.IGNORECASE)
 
         for def_name in proc.stdout.splitlines():
             def_name = def_name.strip()
             if not def_name:
                 continue
 
+            if re_no_automember.match(def_name):
+                break
+
             if def_name not in self.result[key]['definition']:
                 self.result[key]['definition'][def_name] = {}