Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes issue in network_cli where _connected wasn't set #20708

Merged
merged 1 commit into from
Jan 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/ansible/plugins/connection/network_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def _connect(self):
"""Connections to the device and sets the terminal type"""
super(Connection, self)._connect()

display.debug('starting network_cli._connect()')

network_os = self._play_context.network_os
if not network_os:
for cls in terminal_loader.all(class_only=True):
Expand All @@ -94,7 +96,7 @@ def _connect(self):
if not self._terminal:
raise AnsibleConnectionFailure('network os %s is not supported' % network_os)

return (0, 'connected', '')
self._connected = True

@ensure_connect
def open_shell(self):
Expand All @@ -115,6 +117,7 @@ def close(self):
display.vvv('closing connection', host=self._play_context.remote_addr)
self.close_shell()
super(Connection, self).close()
self._connected = False

def close_shell(self):
"""Closes the vty shell if the device supports multiplexing"""
Expand Down