Skip to content

Commit

Permalink
[check_install.py] Convert to Python 3 (sonic-net#5831)
Browse files Browse the repository at this point in the history
- Convert check_install.py script to Python 3
- Reorganize imports per PEP8 standard
- Two blank lines precede functions per PEP8 standard
  • Loading branch information
jleveque authored and santhosh-kt committed Feb 25, 2021
1 parent 16b2183 commit 01c895c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions check_install.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import pexpect
import argparse
import pexpect
import sys
import time


def main():

parser = argparse.ArgumentParser(description='test_login cmdline parser')
Expand All @@ -21,16 +22,16 @@ def main():

login_prompt = 'sonic login:'
passwd_prompt = 'Password:'
cmd_prompt = "%s@sonic:~\$ $" % args.u
cmd_prompt = "{}@sonic:~\$ $".format(args.u)
grub_selection = "The highlighted entry will be executed"

i = 0
while True:
try:
p = pexpect.spawn("telnet 127.0.0.1 %s" % args.p, timeout=600, logfile=sys.stdout)
p = pexpect.spawn("telnet 127.0.0.1 {}".format(args.p), timeout=600, logfile=sys.stdout, encoding='utf-8')
break
except Exception as e:
print str(e)
print(str(e))
i += 1
if i == 10:
raise
Expand Down

0 comments on commit 01c895c

Please sign in to comment.