sanketsudake / ifconfig-parser

Parse ifconfig output collected from local/remote server and retrieve values with goodies
https://pypi.python.org/pypi/ifparser/
BSD 3-Clause "New" or "Revised" License
40 stars 10 forks source link

Ifcfg constructor fails when interface has empty angular brackers. #14

Open Rahul-RB opened 5 years ago

Rahul-RB commented 5 years ago

I have the following interface in my ifconfig: enc0: flags=0<> metric 0 mtu 1536

The constructor call fails: ifdata = Ifcfg(commands.getoutput('ifconfig -a')) as:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.freebsd-8.4-RELEASE-amd64/egg/ifparser/ifconfig.py", line 106, in __init__
  File "build/bdist.freebsd-8.4-RELEASE-amd64/egg/ifparser/ifconfig.py", line 116, in _process
ifparser.ifconfig.ParseError: 'enc0: flags=0<> metric 0 mtu 1536'
sanketsudake commented 5 years ago

@Rahul-RB Would be possible for you to capture ifconfig output in txt file attach here with gist or pastebin ?

Rahul-RB commented 5 years ago

Sure. Here's a gist. Also attached is a text file having the same output.

op.txt