I've tried the script on exos 32.4.1.5 and it doesn't work
I'm getting a syntax error
# run script mlag_data_compare.py
###############################
MLAG peer is {0}
Traceback (most recent call last):
File "/usr/local/cfg/mlag_data_compare.py", line 104, in <module>
main()
File "/usr/local/cfg/mlag_data_compare.py", line 80, in main
print ("MLAG peer is {0}").format(peer_info['peerName'])
AttributeError: 'NoneType' object has no attribute 'format'
The problem seems to be parenthesis placement. The .format() method is being called on the result of print(), not on the string itself. Changing it to
print("MLAG peer is {0}".format(peer_info['peerName']))
Solves the issue.
Affected lines in the code:
- Line 68:
print ("MLAG peer is {0}").format(peer_info['peerName'])
- Line 75:
print ("ISC port {0}").format(isc_port)
- Line 79:
print ("{0} : {1} : {2}").format(isc_vlans['VlanName'],isc_vlans['VlanId'],isc_vlans['tag'])
- Line 84:
print ("MLAG Port {0}, ID: {1}, Rpeer : {2}").format(port['port'], port['idx'], port['remoteportstate'])
- Line 86:
print ("{0} : {1} : {2}").format(mvlan['VlanName'],mvlan['VlanId'],mvlan['tag'])
Thanks for the script !
I've tried the script on exos 32.4.1.5 and it doesn't work
I'm getting a syntax error
The problem seems to be parenthesis placement. The
.format()method is being called on the result ofprint(), not on the string itself. Changing it toSolves the issue.
Affected lines in the code:
print ("MLAG peer is {0}").format(peer_info['peerName'])print ("ISC port {0}").format(isc_port)print ("{0} : {1} : {2}").format(isc_vlans['VlanName'],isc_vlans['VlanId'],isc_vlans['tag'])print ("MLAG Port {0}, ID: {1}, Rpeer : {2}").format(port['port'], port['idx'], port['remoteportstate'])print ("{0} : {1} : {2}").format(mvlan['VlanName'],mvlan['VlanId'],mvlan['tag'])Thanks for the script !