Skip to content

Commit

Permalink
fix KeyError net_base plugin (ansible#34874)
Browse files Browse the repository at this point in the history
Signed-off-by: Trishna Guha <[email protected]>
  • Loading branch information
trishnaguha authored Jan 15, 2018
1 parent ed806f0 commit 43a081d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ansible/plugins/action/net_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run(self, tmp=None, task_vars=None):
if play_context.network_os == 'junos':
play_context.connection = 'netconf'
play_context.port = int(self.provider['port'] or self._play_context.port or 830)
elif self.provider['transport'] in ('nxapi', 'eapi') and play_context.network_os in ('nxos', 'eos'):
elif self.provider.get('transport') in ('nxapi', 'eapi') and play_context.network_os in ('nxos', 'eos'):
play_context.connection = play_context.connection
play_context.port = int(self.provider['port'] or self._play_context.port or 22)
else:
Expand All @@ -78,9 +78,9 @@ def run(self, tmp=None, task_vars=None):
play_context.become_method = 'enable'

if self._play_context.connection == 'local':
if self.provider['transport'] == 'nxapi' and play_context.network_os == 'nxos':
if self.provider.get('transport') == 'nxapi' and play_context.network_os == 'nxos':
self._task.args['provider'] = _NxosActionModule.nxapi_implementation(self.provider, self._play_context)
elif self.provider['transport'] == 'eapi' and play_context.network_os == 'eos':
elif self.provider.get('transport') == 'eapi' and play_context.network_os == 'eos':
self._task.args['provider'] = _EosActionModule.eapi_implementation(self.provider, self._play_context)
else:
socket_path = self._start_connection(play_context)
Expand Down

0 comments on commit 43a081d

Please sign in to comment.