gpt4 book ai didi

linux - KeyError : 'ifname' in convert an OpenWRT tar. gz 到 NetJSON

转载 作者:太空宇宙 更新时间:2023-11-04 11:57:19 24 4
gpt4 key购买 nike

我尝试使用 netjsonconfig 命令行实用程序并尝试了将 OpenWRT tar.gz 转换为 NetJSON 并打印到标准输出(缩进 4 个空格)实用程序

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

但是出现如下错误,

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版本:Python 2.7.6
  • 操作系统:ubuntu:14.04

谁能帮我解决这个问题?

编辑:

http://netjsonconfig.openwisp.org/en/stable/general/commandline_utility.html

最佳答案

网络包含什么?

虽然你得到的异常看起来像一个错误,但你不应该得到一个异常,而是一个失败。

也许最好在 https://github.com/openwisp/netjsonconfig 中打开一个问题

关于linux - KeyError : 'ifname' in convert an OpenWRT tar. gz 到 NetJSON,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53774648/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com