Created
January 29, 2018 08:04
-
-
Save ganeshrn/eb722f185d14f42128e4a62498c44640 to your computer and use it in GitHub Desktop.
network_cli_enable_prompt_issue.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git diff lib/ansible/plugins/connection/network_cli.py | |
diff --git a/lib/ansible/plugins/connection/network_cli.py b/lib/ansible/plugins/connection/network_cli.py | |
index c07e6f7..66411d0 100644 | |
--- a/lib/ansible/plugins/connection/network_cli.py | |
+++ b/lib/ansible/plugins/connection/network_cli.py | |
@@ -266,7 +266,10 @@ class Connection(ConnectionBase): | |
messages = ['updating play_context for connection'] | |
if self._play_context.become is False and play_context.become is True: | |
auth_pass = play_context.become_pass | |
+ display.display("-- update_play_context -> auth_pass: %s" % auth_pass, log_only=True) | |
+ display.display("-- update_play_context -> self.get_prompt() before: %s" % self.get_prompt(), log_only=True) | |
self._terminal.on_become(passwd=auth_pass) | |
+ display.display("-- update_play_context -> self.get_prompt() before: %s" % self.get_prompt(), log_only=True) | |
messages.append('authorizing connection') | |
elif self._play_context.become is True and not play_context.become: | |
@@ -320,7 +323,10 @@ class Connection(ConnectionBase): | |
if self._play_context.become and self._play_context.become_method == 'enable': | |
display.vvvv('firing event: on_become', host=self._play_context.remote_addr) | |
auth_pass = self._play_context.become_pass | |
+ display.display("-- _connect -> auth_pass: %s" % auth_pass, log_only=True) | |
+ display.display("-- _connect -> self.get_prompt() before: %s" % self.get_prompt(), log_only=True) | |
self._terminal.on_become(passwd=auth_pass) | |
+ display.display("-- _connect -> self.get_prompt() After: %s" % self.get_prompt(), log_only=True) | |
display.vvvv('ssh connection has completed successfully', host=self._play_context.remote_addr) | |
self._connected = True | |
@@ -412,9 +418,15 @@ class Connection(ConnectionBase): | |
try: | |
self._history.append(command) | |
self._ssh_shell.sendall(b'%s\r' % command) | |
+ display.display("-- send -> command: %s\r" % command, log_only=True) | |
+ display.display("-- send -> prompt: %s" % prompt, log_only=True) | |
+ display.display("-- send -> answer: %s" % answer, log_only=True) | |
+ display.display("-- send -> newline: %s" % newline, log_only=True) | |
+ display.display("-- send -> sendonly: %s" % sendonly, log_only=True) | |
if sendonly: | |
return | |
response = self.receive(command, prompt, answer, newline) | |
+ display.display("-- send -> response: %s" % response, log_only=True) | |
return to_text(response, errors='surrogate_or_strict') | |
except (socket.timeout, AttributeError): | |
display.vvvv(traceback.format_exc(), host=self._play_context.remote_addr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment