0

I was trying to use the netjsonconfig command line utility and tried the convert an OpenWRT tar.gz to NetJSON and print to standard output (with 4 space indentation) utility

netjsonconfig --native network --backend openwrt --method json -a indent=" "

But following error shows,

ubuntu@ip-172-31-21-48:~/netjsontest$ netjsonconfig --native backup.tar.gz --backend openwrt --method json -a indent="    "

Traceback (most recent call last):
  File "/usr/local/bin/netjsonconfig", line 180, in <module>
instance = backend_class(**options)

  File "/usr/local/lib/python2.7/dist-packages/netjsonconfig/backends/base/backend.py", line 47, in __init__
    self.parse(native)

  File "/usr/local/lib/python2.7/dist-packages/netjsonconfig/backends/base/backend.py", line 280, in parse
    self.to_netjson()

  File "/usr/local/lib/python2.7/dist-packages/netjsonconfig/backends/base/backend.py", line 293, in to_netjson
    value = converter.to_netjson()

  File "/usr/local/lib/python2.7/dist-packages/netjsonconfig/backends/base/converter.py", line 108, in to_netjson
    result = self.to_netjson_loop(block, result, index + 1)

  File "/usr/local/lib/python2.7/dist-packages/netjsonconfig/backends/openwrt/converters/wireless.py", line 118, in to_netjson_loop
    interface = self.__get_netjson_interface(block)

  File "/usr/local/lib/python2.7/dist-packages/netjsonconfig/backends/openwrt/converters/wireless.py", line 246, in __get_netjson_interface
    if interface['name'] == wifi['ifname']:
KeyError: 'ifname'

`

  • Python version: Python 2.7.6
  • OS: ubuntu: 14.04

Can anyone help me to get this fixed?

Edit :

http://netjsonconfig.openwisp.org/en/stable/general/commandline_utility.html
Usman Maqbool
  • 3,351
  • 10
  • 31
  • 48
Sajith
  • 11
  • 1

1 Answers1

0

What does network contain?

The exception you're getting looks like a bug though, you shouldn't get an exception but a failure.

Maybe is better to open an issue in https://github.com/openwisp/netjsonconfig

nemesisdesign
  • 8,159
  • 12
  • 58
  • 97