Skip to content
Snippets Groups Projects
Commit 8d3ce08e authored by Neda Moeini's avatar Neda Moeini Committed by Karel van Klink
Browse files

Deleted extra functionality from NetboxClient

parent a363a69d
No related branches found
No related tags found
1 merge request!92Feature/nat 314 integrate iptrunk modification with netbox
Pipeline #84319 passed
......@@ -268,26 +268,6 @@ class NetboxClient:
interface.save()
return
def deallocate_interface(self, device_name: str, iface_name: str) -> Interfaces:
"""Allocate an interface by marking it as connected."""
device = self.get_device_by_name(device_name)
interface = self.netbox.dcim.interfaces.get(device_id=device.id, name=iface_name)
# Check if interface is available
if interface is None:
raise NotFoundError(f"Interface: {iface_name} on device: {device_name} not found.")
# Check if interface is reserved
if interface.mark_connected:
raise WorkflowStateError(f"The interface: {iface_name} on device: {device_name} is already allocated.")
# allocate interface by mark as connected
interface.mark_connected = False
interface.save()
return interface
def get_available_lags(self, router_id: UUID) -> list[str]:
"""Return all available :term:`LAG`s not assigned to a device."""
......
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