Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Erst wird die funktion "sshconnect()" ausgeführt um sich einzuloggen.
- Danach wird versucht in der function "shwPrt()" ein Befejl abzusetzen.
- Folgender Fehler:
- --------------------
- Traceback (most recent call last):
- File "main.py", line 179, in <module>
- main_menu()
- File "main.py", line 43, in main_menu
- exec_menu(choice)
- File "main.py", line 54, in exec_menu
- menu_actions[ch]()
- File "main.py", line 80, in shwPrt
- SSH.sendline("configure system clock domain 1 source 1")
- AttributeError: 'str' object has no attribute 'sendline'
- -----------------------------------------------
- # Show Port Status
- def shwPrt():
- SSH.sendline("configure system clock domain 1 source 1")
- SSH.sendline("show status")
- SSH.prompt()
- OUTPUT = SSH.before
- exec_menu(choice)
- def sshconnect ():
- os.system('clear')
- SSH = pxssh.pxssh()
- USER = "su"
- while True:
- try:
- PASS = PASS1
- print "Logging in...\n"
- SSH.login(IP, USER, PASS, auto_prompt_reset=False)
- break
- except:
- print "Trying another Password..."
- PASS = PASS2
- SSH.login(IP, USER, PASS, auto_prompt_reset=False)
- print "The Password was %s. this should not be! Consider changing at as soon as possible!\n" % PASS
- break
- try:
- PASS = PASS3
- print "Trying another Password..."
- SSH.login(IP, USER, PASS, auto_prompt_reset=False)
- print "The Password was %s. this should not be! Consider changing at as soon as possible!\n" % PASS
- break
- except:
- PASS = PASS4
- print "Trying another Password. This is the last try!"
- SSH.login(IP, USER, PASS, auto_prompt_reset=False)
- print "The Password was %s. this should not be! Consider changing at as soon as possible!\n" % PASS
- break
- SSH.PROMPT = ".*?(#) $" #Alternative: "(#) $"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement