fix(network): cable
https://github.com/netbox-community/netbox/issues/9102
This commit is contained in:
parent
818c835711
commit
1429fedb9d
1 changed files with 7 additions and 5 deletions
|
@ -556,10 +556,12 @@ class ServerNetwork(Network):
|
|||
switch_ip,
|
||||
))
|
||||
cable = nb.dcim.cables.create(
|
||||
termination_a_id=nb_server_interface.id,
|
||||
termination_a_type="dcim.interface",
|
||||
termination_b_id=nb_switch_interface.id,
|
||||
termination_b_type="dcim.interface",
|
||||
a_terminations=[
|
||||
{"object_type": "dcim.interface", "object_id": nb_server_interface.id},
|
||||
],
|
||||
b_terminations=[
|
||||
{"object_type": "dcim.interface", "object_id": nb_switch_interface.id},
|
||||
],
|
||||
)
|
||||
nb_server_interface.cable = cable
|
||||
logging.info(
|
||||
|
@ -579,7 +581,7 @@ class ServerNetwork(Network):
|
|||
switch_ip, switch_interface, nb_server_interface
|
||||
)
|
||||
else:
|
||||
nb_sw_int = nb_server_interface.cable.termination_b
|
||||
nb_sw_int = nb_server_interface.cable.b_terminations[0]
|
||||
nb_sw = nb_sw_int.device
|
||||
nb_mgmt_int = nb.dcim.interfaces.get(
|
||||
device_id=nb_sw.id,
|
||||
|
|
Loading…
Reference in a new issue