I am trying to run power kvm in jenkins to power cycle some hosts. To control Power kvm I am using telnet. I am using sendKey command. It seems that jenkins cannot work with VBS, so I tried running telnet using python but for some reason it fails by closing the connection after few seconds. Can some one help in this issue ? Note that I working in Windows so Expect tool is not working for me... below is my python script:
tn = telnetlib.Telnet(HOST)
tn.set_d`enter code here`ebuglevel(9)
tn.read_until('login: ', 5)
tn.write('XXXXX\r\n')
tn.read_until('Password: ', 5)
tn.write('XXXXX\r\n')
tn.read_until(" ==>", 5)
tn.write('2\r\n')
tn.read_until(" ==>", 5)
tn.write('1\r\n')
I was expecting that python script will work as the VBS script.