Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: can only concatenate list (not "str") to list #118

Closed
imp1sh opened this issue Oct 13, 2018 · 4 comments
Closed

TypeError: can only concatenate list (not "str") to list #118

imp1sh opened this issue Oct 13, 2018 · 4 comments

Comments

@imp1sh
Copy link

@imp1sh imp1sh commented Oct 13, 2018

I made a backup of two different systems (Archer C7 v2 and X86_64 Qemu guest).
Both I tried to reverse with the following lines:

from netjsonconfig import OpenWrt
#router = OpenWrt(native=open('./backup-g0.sim.libcom.de-2018-10-10.tar.gz'))
router = OpenWrt(native=open('./backup-OpenWrt-2018-10-10.tar.gz'))
print(router.render)

In both cases this results in the following error:
python reverse.py

Traceback (most recent call last):
  File "reverse.py", line 3, in <module>
    router = OpenWrt(native=open('./backup-OpenWrt-2018-10-10.tar.gz'))
  File "/usr/lib/python2.7/site-packages/netjsonconfig/backends/base/backend.py", line 47, in __init__
    self.parse(native)
  File "/usr/lib/python2.7/site-packages/netjsonconfig/backends/base/backend.py", line 280, in parse
    self.to_netjson()
  File "/usr/lib/python2.7/site-packages/netjsonconfig/backends/base/backend.py", line 293, in to_netjson
    value = converter.to_netjson()
  File "/usr/lib/python2.7/site-packages/netjsonconfig/backends/base/converter.py", line 108, in to_netjson
    result = self.to_netjson_loop(block, result, index + 1)
  File "/usr/lib/python2.7/site-packages/netjsonconfig/backends/openwrt/converters/interfaces.py", line 206, in to_netjson_loop
    interface = self.__netjson_interface(block)
  File "/usr/lib/python2.7/site-packages/netjsonconfig/backends/openwrt/converters/interfaces.py", line 217, in __netjson_interface
    interface = self.__netjson_addresses(interface)
  File "/usr/lib/python2.7/site-packages/netjsonconfig/backends/openwrt/converters/interfaces.py", line 262, in __netjson_addresses
    for address in ipv4 + ipv6:
TypeError: can only concatenate list (not "str") to list

new.tar.gz

@nemesisdesign
Copy link
Member

@nemesisdesign nemesisdesign commented Oct 18, 2018

This is somewhat related to #104, the backward conversion process needs to be improved.
I'm adding these two tasks to the task list for the Google Code-In program.

@nemesisdesign nemesisdesign added this to To do (general) in OpenWISP Contributor's Board via automation Nov 4, 2018
@nemesisdesign nemesisdesign moved this from To do (general) to To do (python & django) in OpenWISP Contributor's Board Nov 4, 2018
@nemesisdesign
Copy link
Member

@nemesisdesign nemesisdesign commented Nov 9, 2018

@imp1sh, @anonguy is doing great work to fix the issue you reported in #119. Thanks again for your report. I hope we'll get it fixed very soon.

@nemesisdesign
Copy link
Member

@nemesisdesign nemesisdesign commented Nov 9, 2018

(actually his patch should already work, only some minor corrections are missing)

@nemesisdesign nemesisdesign moved this from To do (python & django) to To do (general) in OpenWISP Contributor's Board Nov 11, 2018
@nemesisdesign nemesisdesign moved this from To do (general) to In progress in OpenWISP Contributor's Board Nov 11, 2018
@yasharora102
Copy link
Contributor

@yasharora102 yasharora102 commented Nov 22, 2018

If no one is working on this I have taken this task under GCI. Also, It would be great to get the current position of the bug. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants