Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Python 3 support in panos_admpwd #192

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions library/panos_admpwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,19 @@

def wait_with_timeout(module, shell, prompt, timeout=60):
now = time.time()
result = ""
result = b""
while True:
if shell.recv_ready():
result += shell.recv(_PROMPTBUFF)
endresult = result.strip()
resultstr = result.decode("utf-8")
endresult = resultstr.strip()
if len(endresult) != 0 and endresult[-1] == prompt:
break

if time.time() - now > timeout:
module.fail_json(msg="Timeout waiting for prompt")

return result
return resultstr


def set_panwfw_password(module, ip_address, key_filename, newpassword, username):
Expand Down