From d4bd54d3b8f4a8be04653c5a260ca63886f84650 Mon Sep 17 00:00:00 2001 From: Chris Alfonso Date: Fri, 7 Apr 2017 14:34:47 -0600 Subject: [PATCH] Fixes #23388 Network provider masks too much (#23418) * Fixes #23388 Network provider masks too much * Fix trailing whitespace --- lib/ansible/module_utils/eos.py | 2 +- lib/ansible/module_utils/ios.py | 2 +- lib/ansible/module_utils/iosxr.py | 2 +- lib/ansible/module_utils/junos.py | 2 +- lib/ansible/module_utils/vyos.py | 2 +- lib/ansible/plugins/action/dellos10.py | 9 ++++++++- lib/ansible/plugins/action/dellos6.py | 10 +++++++++- lib/ansible/plugins/action/dellos9.py | 9 ++++++++- lib/ansible/plugins/action/eos.py | 9 ++++++++- lib/ansible/plugins/action/ios.py | 9 ++++++++- lib/ansible/plugins/action/iosxr.py | 5 +++++ lib/ansible/plugins/action/junos.py | 9 ++++++++- lib/ansible/plugins/action/sros.py | 9 ++++++++- lib/ansible/plugins/action/vyos.py | 9 ++++++++- 14 files changed, 75 insertions(+), 13 deletions(-) diff --git a/lib/ansible/module_utils/eos.py b/lib/ansible/module_utils/eos.py index be361bc802f..0c8555cdf9c 100644 --- a/lib/ansible/module_utils/eos.py +++ b/lib/ansible/module_utils/eos.py @@ -53,7 +53,7 @@ eos_argument_spec = { 'validate_certs': dict(type='bool', default=True), 'timeout': dict(type='int'), - 'provider': dict(type='dict', no_log=True), + 'provider': dict(type='dict'), 'transport': dict(choices=['cli', 'eapi']) } diff --git a/lib/ansible/module_utils/ios.py b/lib/ansible/module_utils/ios.py index 35a11e2fdd8..21df837d1ca 100644 --- a/lib/ansible/module_utils/ios.py +++ b/lib/ansible/module_utils/ios.py @@ -40,7 +40,7 @@ ios_argument_spec = { 'authorize': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTHORIZE']), type='bool'), 'auth_pass': dict(fallback=(env_fallback, ['ANSIBLE_NET_AUTH_PASS']), no_log=True), 'timeout': dict(type='int'), - 'provider': dict(type='dict', no_log=True), + 'provider': dict(type='dict'), } def check_args(module, warnings): diff --git a/lib/ansible/module_utils/iosxr.py b/lib/ansible/module_utils/iosxr.py index 9b2deacf9c1..570b904b34d 100644 --- a/lib/ansible/module_utils/iosxr.py +++ b/lib/ansible/module_utils/iosxr.py @@ -39,7 +39,7 @@ iosxr_argument_spec = { 'password': dict(fallback=(env_fallback, ['ANSIBLE_NET_PASSWORD']), no_log=True), 'ssh_keyfile': dict(fallback=(env_fallback, ['ANSIBLE_NET_SSH_KEYFILE']), type='path'), 'timeout': dict(type='int'), - 'provider': dict(type='dict', no_log=True) + 'provider': dict(type='dict') } def check_args(module, warnings): diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py index e0827c437c1..21fed91bd4c 100644 --- a/lib/ansible/module_utils/junos.py +++ b/lib/ansible/module_utils/junos.py @@ -37,7 +37,7 @@ junos_argument_spec = { 'password': dict(fallback=(env_fallback, ['ANSIBLE_NET_PASSWORD']), no_log=True), 'ssh_keyfile': dict(fallback=(env_fallback, ['ANSIBLE_NET_SSH_KEYFILE']), type='path'), 'timeout': dict(type='int', default=10), - 'provider': dict(type='dict', no_log=True), + 'provider': dict(type='dict'), 'transport': dict() } diff --git a/lib/ansible/module_utils/vyos.py b/lib/ansible/module_utils/vyos.py index f60b5486740..bc86c464ee8 100644 --- a/lib/ansible/module_utils/vyos.py +++ b/lib/ansible/module_utils/vyos.py @@ -40,7 +40,7 @@ vyos_argument_spec = { 'ssh_keyfile': dict(fallback=(env_fallback, ['ANSIBLE_NET_SSH_KEYFILE']), type='path'), 'timeout': dict(type='int'), - 'provider': dict(type='dict', no_log=True), + 'provider': dict(type='dict'), } def check_args(module, warnings): diff --git a/lib/ansible/plugins/action/dellos10.py b/lib/ansible/plugins/action/dellos10.py index c656ad250f6..102ca6feae1 100644 --- a/lib/ansible/plugins/action/dellos10.py +++ b/lib/ansible/plugins/action/dellos10.py @@ -92,7 +92,14 @@ class ActionModule(_ActionModule): self._play_context.become = False self._play_context.become_method = None - return super(ActionModule, self).run(tmp, task_vars) + result = super(ActionModule, self).run(tmp, task_vars) + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + + return result def _get_socket_path(self, play_context): ssh = connection_loader.get('ssh', class_only=True) diff --git a/lib/ansible/plugins/action/dellos6.py b/lib/ansible/plugins/action/dellos6.py index a296ccfddf1..dfbc349afe0 100644 --- a/lib/ansible/plugins/action/dellos6.py +++ b/lib/ansible/plugins/action/dellos6.py @@ -87,7 +87,15 @@ class ActionModule(_ActionModule): if self._play_context.become_method == 'enable': self._play_context.become = False self._play_context.become_method = None - return super(ActionModule, self).run(tmp, task_vars) + + result = super(ActionModule, self).run(tmp, task_vars) + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + + return result def _get_socket_path(self, play_context): ssh = connection_loader.get('ssh', class_only=True) diff --git a/lib/ansible/plugins/action/dellos9.py b/lib/ansible/plugins/action/dellos9.py index 3fff897830e..6222da4f214 100644 --- a/lib/ansible/plugins/action/dellos9.py +++ b/lib/ansible/plugins/action/dellos9.py @@ -92,7 +92,14 @@ class ActionModule(_ActionModule): self._play_context.become = False self._play_context.become_method = None - return super(ActionModule, self).run(tmp, task_vars) + result = super(ActionModule, self).run(tmp, task_vars) + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + + return result def _get_socket_path(self, play_context): ssh = connection_loader.get('ssh', class_only=True) diff --git a/lib/ansible/plugins/action/eos.py b/lib/ansible/plugins/action/eos.py index 6107b2fe2fb..f3cd2dfe417 100644 --- a/lib/ansible/plugins/action/eos.py +++ b/lib/ansible/plugins/action/eos.py @@ -117,7 +117,14 @@ class ActionModule(_ActionModule): self._task.args['provider'] = provider - return super(ActionModule, self).run(tmp, task_vars) + result = super(ActionModule, self).run(tmp, task_vars) + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + + return result def _get_socket_path(self, play_context): ssh = connection_loader.get('ssh', class_only=True) diff --git a/lib/ansible/plugins/action/ios.py b/lib/ansible/plugins/action/ios.py index 976f81f8dd8..0a1cafbaf5a 100644 --- a/lib/ansible/plugins/action/ios.py +++ b/lib/ansible/plugins/action/ios.py @@ -87,7 +87,14 @@ class ActionModule(_ActionModule): self._play_context.become = False self._play_context.become_method = None - return super(ActionModule, self).run(tmp, task_vars) + result = super(ActionModule, self).run(tmp, task_vars) + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + + return result def _get_socket_path(self, play_context): ssh = connection_loader.get('ssh', class_only=True) diff --git a/lib/ansible/plugins/action/iosxr.py b/lib/ansible/plugins/action/iosxr.py index 18c88ab6e9e..b5e1daa0ad8 100644 --- a/lib/ansible/plugins/action/iosxr.py +++ b/lib/ansible/plugins/action/iosxr.py @@ -84,6 +84,11 @@ class ActionModule(_ActionModule): result = super(ActionModule, self).run(tmp, task_vars) + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + return result def _get_socket_path(self, play_context): diff --git a/lib/ansible/plugins/action/junos.py b/lib/ansible/plugins/action/junos.py index d347940bc3b..5dae42f2c0e 100644 --- a/lib/ansible/plugins/action/junos.py +++ b/lib/ansible/plugins/action/junos.py @@ -102,7 +102,14 @@ class ActionModule(_ActionModule): task_vars['ansible_socket'] = socket_path - return super(ActionModule, self).run(tmp, task_vars) + result = super(ActionModule, self).run(tmp, task_vars) + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + + return result def _get_socket_path(self, play_context): ssh = connection_loader.get('ssh', class_only=True) diff --git a/lib/ansible/plugins/action/sros.py b/lib/ansible/plugins/action/sros.py index c3fa842c5bd..9d3a31fba6a 100644 --- a/lib/ansible/plugins/action/sros.py +++ b/lib/ansible/plugins/action/sros.py @@ -78,7 +78,14 @@ class ActionModule(_ActionModule): task_vars['ansible_socket'] = socket_path - return super(ActionModule, self).run(tmp, task_vars) + result = super(ActionModule, self).run(tmp, task_vars) + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + + return result def _get_socket_path(self, play_context): ssh = connection_loader.get('ssh', class_only=True) diff --git a/lib/ansible/plugins/action/vyos.py b/lib/ansible/plugins/action/vyos.py index 2720d1fa90b..0ee7dcd092a 100644 --- a/lib/ansible/plugins/action/vyos.py +++ b/lib/ansible/plugins/action/vyos.py @@ -80,7 +80,14 @@ class ActionModule(_ActionModule): task_vars['ansible_socket'] = socket_path - return super(ActionModule, self).run(tmp, task_vars) + result = super(ActionModule, self).run(tmp, task_vars) + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass + + return result def _get_socket_path(self, play_context): ssh = connection_loader.get('ssh', class_only=True)