From 80d8058f5c49c5d10eb3e527bd9d72052143a629 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Wed, 31 Jul 2019 08:46:17 -0400 Subject: [PATCH] Change sub_plugin check to completely ignore napalm (#59298) This also fixes cases where sub_plugin might not be loaded in executor --- lib/ansible/executor/task_executor.py | 2 +- lib/ansible/plugins/connection/napalm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index f453ddb819..7e7000563b 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -942,7 +942,7 @@ class TaskExecutor: option_vars = C.config.get_plugin_vars('connection', connection._load_name) plugin = connection._sub_plugin - if plugin['type'] != 'external': + if plugin.get('type'): option_vars.extend(C.config.get_plugin_vars(plugin['type'], plugin['name'])) options = {} diff --git a/lib/ansible/plugins/connection/napalm.py b/lib/ansible/plugins/connection/napalm.py index 22ebd4df2e..c7b13a7b5a 100644 --- a/lib/ansible/plugins/connection/napalm.py +++ b/lib/ansible/plugins/connection/napalm.py @@ -183,7 +183,7 @@ class Connection(NetworkConnectionBase): self.napalm.open() - self._sub_plugin = {'type': 'external', 'name': 'napalm', 'obj': self.napalm} + self._sub_plugin = {'name': 'napalm', 'obj': self.napalm} self.queue_message('vvvv', 'created napalm device for network_os %s' % self._network_os) self._connected = True