Question

Python script freezes on "show vlan" command

  • 5 July 2019
  • 2 replies
  • 189 views

I am trying to get the output of "show vlan " so I can manipulate the data in a python script, yet my script stalls on the following line: exsh.clicmd("show vlan", True)

When I kill the script I get the following error: TypeError: 'NoneType' object is not callable

This error does not occur with other commands, like "show fdb vlan 1". I have tried "disable clipaging" since I thought it might be a problem with Python waiting for more data that isn't coming, but that didn't work.

Is there something I am missing, or is it possible that the output of "show vlan" is too large for Python to deal with? This switch has over 700 VLANs.

2 replies

Userlevel 3
Maybe you should share your script, or a snippet enough to reproduce the problem, and the exact error message.
Userlevel 5
I did the following but didn't have any issues using EXOS 21.1 or 30.2 on a X450G2-48p-10G4

#create vlan 100-1000

Created a 2 line script x.py

a = exsh.clicmd("show vlan", True)
print a

#run script x.py

Reply