summaryrefslogtreecommitdiff
path: root/lib/ansible/cli
diff options
context:
space:
mode:
authorGanesh Nalawade <ganesh634@gmail.com>2019-11-03 04:10:30 +0530
committerGitHub <noreply@github.com>2019-11-03 04:10:30 +0530
commitc27e47327f902dddf0b93767e387cacdfc12e11f (patch)
tree7e1191221397e9362e70366e0bbda1f26325b12e /lib/ansible/cli
parent73526b9d658c300de1992b14266c23380b9d1502 (diff)
downloadansible-c27e47327f902dddf0b93767e387cacdfc12e11f.tar.gz
Refactor CLI prompt mode check for network plugins (#63945)
* Refactor CLI prompt mode check for network plugins * Move the CLI prompt mode check logic from action plugin to the controller side with the cliconf plugins. * This refactor also allows the network modules to initialise the persistent connection with remote device only when it is required. * Fix review comments
Diffstat (limited to 'lib/ansible/cli')
-rwxr-xr-xlib/ansible/cli/scripts/ansible_connection_cli_stub.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/cli/scripts/ansible_connection_cli_stub.py b/lib/ansible/cli/scripts/ansible_connection_cli_stub.py
index 1f04039329..20bfc6b3a8 100755
--- a/lib/ansible/cli/scripts/ansible_connection_cli_stub.py
+++ b/lib/ansible/cli/scripts/ansible_connection_cli_stub.py
@@ -305,8 +305,9 @@ def main():
pc_data = to_text(init_data)
try:
conn.update_play_context(pc_data)
+ conn.set_cli_prompt_context()
except Exception as exc:
- # Only network_cli has update_play context, so missing this is
+ # Only network_cli has update_play context and set_cli_prompt_context, so missing this is
# not fatal e.g. netconf
if isinstance(exc, ConnectionError) and getattr(exc, 'code', None) == -32601:
pass