Here is my problem. I'm using plink to ssh to devices and pull info off. I need to manipulate this data so that extra 0 at the end is making it difficult.
C:\Python30>pyt hon PLINKSSHtest.py
Enter your username: josh
Password:
plink -pw nowayjose -ssh nope@1.1.1.1 "show run | inc hostname"
hostname net-R2
0 <------------MY ISSUE
C:\Python30>pli nk -pw nowayjose -ssh nope@1.1.1.1 "show run | inc hostname"
hostname net-R2
<------------WHAT I EXPECT
C:\Python30>
Here's the code (very simple code):
I'm a n00b so the more english you can use the better -.o
Thanks in advance!!
C:\Python30>pyt hon PLINKSSHtest.py
Enter your username: josh
Password:
plink -pw nowayjose -ssh nope@1.1.1.1 "show run | inc hostname"
hostname net-R2
0 <------------MY ISSUE
C:\Python30>pli nk -pw nowayjose -ssh nope@1.1.1.1 "show run | inc hostname"
hostname net-R2
<------------WHAT I EXPECT
C:\Python30>
Here's the code (very simple code):
Code:
def read_dev():
# Print statement here for debugging
print ("plink -pw " + password + " -ssh " + user + "@" + HOST + " " + command)
cur_dev = os.system("plink -pw " + password + " -ssh " + user + "@" + HOST + " " + command)
return(cur_dev)
HOST = None
user = input("Enter your username: ")
password = getpass.getpass()
command = '"show run | inc hostname"'
HOST = '1.1.1.1'
print (read_dev())
Thanks in advance!!
Comment