Skip to content
Snippets Groups Projects
Commit 079fc932 authored by Neda Moeini's avatar Neda Moeini Committed by Neda Moeini
Browse files

Updated create device functionality to install only module bays that are...

Updated create device functionality to install only module bays that are mentioned in the device info file.
parent 047d4901
No related branches found
No related tags found
1 merge request!82IP-TRUNK-CREATE-WORKFLOW-NETBOX-INTEGRATION
......@@ -125,8 +125,8 @@ class NetBoxClient:
)
module_bays = list(self.netbox.dcim.module_bays.filter(device_id=device.id))
card_type = self.netbox.dcim.module_types.get(model=tier_info.module_type)
# TODo: Use the module_bays_slots to create the modules
for module_bay in module_bays:
valid_module_bays = [bay for bay in module_bays if int(bay.position) in tier_info.module_bays_slots]
for module_bay in valid_module_bays:
self.netbox.dcim.modules.create(
device=device.id,
module_bay=module_bay.id,
......@@ -228,7 +228,7 @@ class NetBoxClient:
# Get the existing lag interfaces for the device
lag_interface_names = [
interface["name"] for interface in self.netbox.dcim.interfaces.filter(device_name=device.id, type="lag")
interface["name"] for interface in self.netbox.dcim.interfaces.filter(device=device.name, type="lag")
]
# Generate all feasible lags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment