diff --git a/gso/services/netbox_client.py b/gso/services/netbox_client.py index 6177c16862533feac3e0c616e9d77d3f95f0f257..178f69969d31a48be95686d2d747f81ea7227ce1 100644 --- a/gso/services/netbox_client.py +++ b/gso/services/netbox_client.py @@ -194,7 +194,6 @@ class NetboxClient: raise WorkflowStateError( f"The interface: {iface_name} on device: {device_name} already belongs to a LAG: {iface.lag.name}." ) - iface.lag = lag.id # Set description if provided diff --git a/utils/netboxcli.py b/utils/netboxcli.py index 0b6b283275a4584d9bdf4c19945066b79cc9d85c..6b69c5b15cda35ef23bfd3f2071e9169b2861604 100644 --- a/utils/netboxcli.py +++ b/utils/netboxcli.py @@ -137,17 +137,14 @@ def delete() -> None: pass -@attach.command() -@click.option("--fqdn", help="Device name where to attach interface to lag") -@click.option("--iface", help="Interface name to attach to lag") -@click.option("--lag", help="LAG name to attach interface") -def interface_to_lag(fqdn: str, iface: str, lag: str) -> None: - click.echo(f"Attaching interface to lag: device ={fqdn}, interface name={iface} to lag={lag}") - new_iface = NetboxClient().attach_interface_to_lag(fqdn, lag, iface) - click.echo(new_iface) +@delete.command() # type: ignore[no-redef] +@click.option("--fqdn", help="Name of device to delete") +def device(fqdn: str) -> None: + click.echo(f"Deleting device: device={fqdn}") + NetboxClient().delete_device(fqdn) -@delete.command() +@delete.command() # type: ignore[no-redef] @click.option("--fqdn", help="Device name from where to get interface to delete") @click.option("--iface", help="Name of interface name to delete") def interface(fqdn: str, iface: str) -> None: