[stable-2.9] Connect before reading the prompt? (#61797) (#61883)

* [stable-2.9] Connect before reading the prompt? (#61797)
(cherry picked from commit a365e77)

Co-authored-by: Nathaniel Case <ncase@redhat.com>

* Add changelog

* Update changelogs/fragments/61797-netcli-get_prompt.yaml

Co-Authored-By: Toshio Kuratomi <a.badger@gmail.com>
pull/62378/head
Nathaniel Case 5 years ago committed by Toshio Kuratomi
parent 1219d8381f
commit 0666a2987d

@ -0,0 +1,2 @@
bugfixes:
- "network_cli - ensure connection is established before returning the current prompt"

@ -346,6 +346,7 @@ class Connection(NetworkConnectionBase):
name += "paramiko [%s]" % self._play_context.remote_addr
return name
@ensure_connect
def get_prompt(self):
"""Returns the current prompt from the device"""
return self._matched_prompt

Loading…
Cancel
Save