Skip to content
Snippets Groups Projects
Commit 867552b3 authored by Ubuntu's avatar Ubuntu Committed by Neda Moeini
Browse files

NAT-243 removed all custom fields code

parent 0be44f4d
No related branches found
No related tags found
1 merge request!77Netbox integration including intial CLI for populating base data and ...
...@@ -83,13 +83,13 @@ def get_device_by_name(nbclient, device_name): ...@@ -83,13 +83,13 @@ def get_device_by_name(nbclient, device_name):
# get all interfaces for a device # get all interfaces for a device
def get_interfaces_by_device(nbclient, device_name): def get_interfaces_by_device(nbclient, device_name: str, speed: str):
device = get_device_by_name(nbclient, device_name) device = get_device_by_name(nbclient, device_name)
return list(nbclient.dcim.interfaces.filter(device_id=device.id, return list(nbclient.dcim.interfaces.filter(device_id=device.id,
# enabled=False, enabled=False,
# mark_connected=False, mark_connected=False,
custom_fields={"states": "UNUSED"} speed=speed
)) ))
...@@ -97,6 +97,7 @@ def get_interfaces_by_device(nbclient, device_name): ...@@ -97,6 +97,7 @@ def get_interfaces_by_device(nbclient, device_name):
def create_interface(nbclient, def create_interface(nbclient,
iface_name: str, iface_name: str,
type: str, type: str,
speed: str,
device_name: str) -> dict: device_name: str) -> dict:
""" """
Creates a new interface on Creates a new interface on
...@@ -110,9 +111,9 @@ def create_interface(nbclient, ...@@ -110,9 +111,9 @@ def create_interface(nbclient,
new_iface = nbclient.dcim.interfaces.create(name=iface_name, new_iface = nbclient.dcim.interfaces.create(name=iface_name,
type=type, type=type,
speed=speed,
enabled=False, enabled=False,
mark_connected=False, mark_connected=False,
custom_fields={"states": "RESERVED"},
device=device.id) device=device.id)
return dict(new_iface) return dict(new_iface)
......
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