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:
parent
0b15ad00c1
commit
9ddceaf78d
1 changed files with 2 additions and 1 deletions
|
@ -58,7 +58,8 @@ class TerminalModule(TerminalBase):
|
|||
raise AnsibleConnectionFailure('unable to set terminal parameters')
|
||||
|
||||
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
|
||||
|
||||
cmd = {u'command': u'enable'}
|
||||
|
|
Loading…
Reference in a new issue