gather_facts sees collection networking connection (#76954)

needed to properly propagate some arguments by convention: subset, filter

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
pull/76966/head
Brian Coca 2 years ago committed by GitHub
parent 9a4ff01a4f
commit 5bddecb048
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- gather_facts action now handles the move of base connection plugin types into collections to add/prevent subset argument correctly

@ -22,8 +22,13 @@ class ActionModule(ActionBase):
# deal with 'setup specific arguments'
if fact_module not in C._ACTION_SETUP:
# TODO: remove in favor of controller side argspec detecing valid arguments
# network facts modules must support gather_subset
if self._connection._load_name not in ('network_cli', 'httpapi', 'netconf'):
try:
name = self._connection.redirected_names[-1].replace('ansible.netcommon.', '', 1)
except (IndexError, AttributeError):
name = self._connection._load_name.split('.')[-1]
if name not in ('network_cli', 'httpapi', 'netconf'):
subset = mod_args.pop('gather_subset', None)
if subset not in ('all', ['all']):
self._display.warning('Ignoring subset(%s) for %s' % (subset, fact_module))

Loading…
Cancel
Save