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)
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)
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] = {}