customizations icon indicating copy to clipboard operation
customizations copied to clipboard

add_device_type_components not working

Open PaulR282 opened this issue 3 years ago • 3 comments

An exception occurred: TypeError: RearPortTemplate.instantiate() takes 1 positional argument but 2 were given

Traceback (most recent call last):
  File "/opt/netbox/netbox/extras/scripts.py", line 461, in _run_script
    script.output = script.run(data=data, commit=commit)
  File "/etc/netbox/scripts/add_device_type_components.py", line 44, in run
    items = [
  File "/etc/netbox/scripts/add_device_type_components.py", line 45, in <listcomp>
    x.instantiate(device)
TypeError: RearPortTemplate.instantiate() takes 1 positional argument but 2 were given

Getting this error on v3.2.7

PaulR282 avatar Jul 26 '22 09:07 PaulR282

File "/etc/netbox/scripts/add_device_type_components.py"

There's a bug in your custom script. FYI device component templates aren't meant to be instantiated directly.

jeremystretch avatar Jul 26 '22 12:07 jeremystretch

File "/etc/netbox/scripts/add_device_type_components.py"

There's a bug in your custom script. FYI device component templates aren't meant to be instantiated directly.

Yes, I know, but it is a script from this repo.

PaulR282 avatar Jul 26 '22 13:07 PaulR282

Oh ha, sorry. Was going through my notifications and missed what repo this was in.

jeremystretch avatar Jul 26 '22 14:07 jeremystretch

fixed in #68

PaulR282 avatar Oct 04 '22 12:10 PaulR282