1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix to resolve bug 46671, which now handles checking for Nonetype connection prompt (#46677)

* added Nonetype check

* implemented review comment

* review changes
This commit is contained in:
Sumit Jaiswal 2018-10-15 11:21:06 +05:30 committed by GitHub
parent 0b15ad00c1
commit 9ddceaf78d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,8 @@ class TerminalModule(TerminalBase):
raise AnsibleConnectionFailure('unable to set terminal parameters') raise AnsibleConnectionFailure('unable to set terminal parameters')
def on_become(self, passwd=None): def on_become(self, passwd=None):
if self._get_prompt().endswith(b'#'): conn_prompt = self._get_prompt()
if not conn_prompt or conn_prompt.endswith(b'#'):
return return
cmd = {u'command': u'enable'} cmd = {u'command': u'enable'}