From 6a414371a194187732a09e0a733cfe3b29e8e06a Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sat, 25 Mar 2017 07:45:08 -0400 Subject: [PATCH] fixes issue where nxos module will fail due to KeyError (#22966) Updates nxos action handler to handle deleting provider key if exists or silently continuing if a KeyError is raised. --- lib/ansible/plugins/action/nxos.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/nxos.py b/lib/ansible/plugins/action/nxos.py index d2c9a7ff5b..dc2cf5092c 100644 --- a/lib/ansible/plugins/action/nxos.py +++ b/lib/ansible/plugins/action/nxos.py @@ -117,7 +117,11 @@ class ActionModule(_ActionModule): self._task.args['transport'] = transport result = super(ActionModule, self).run(tmp, task_vars) - del result['invocation']['module_args']['provider'] + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass return result