Hi Folks,
Just wanted to get your inputs on the error I am facing. We have a web application that lets users run commands across multiple vendor network platforms. While this works great with platforms that have openAPI's, we decided to use trigger/commando for the legacy Cisco stuff. Trigger is really cool, here is a simple function we have
def cisco(deviceList, showCommand):
result = {}
devices = deviceList.splitlines()
c = Commando(devices=devices, commands=showCommand, creds=(username,password))
c.run()
for device in c.results.keys():
for command_result in c.results.values():
result[device] = command_result.values()
return result
while I try to execute this code, I get the following exception:
[Tue Nov 18 16:50:22.004975 2014] [:error] [pid 16361] File "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/twisted/conch/ssh/transport.py", line 358, in sendPacket
[Tue Nov 18 16:50:22.004986 2014] [:error] [pid 16361] payload + randbytes.secureRandom(lenPad))
[Tue Nov 18 16:50:22.004997 2014] [:error] [pid 16361] exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xa7 in position 1: ordinal not in range(128)
I have tried to change to other encoding (utf-8) types but get similar error for other coding types. The code works perfectly fine through the Django shell. I have researched through stack overflow but seem to have hit a wall. So just wanted to see if you have any pointers on how I could proceed.
Thanks.
Regards,
Jay