Fixed location hostgroup bug

This commit is contained in:
TheNetworkGuy 2024-10-31 20:03:09 +01:00
parent 9417908994
commit ffc2aa1947

View File

@ -79,7 +79,7 @@ def main(arguments):
netbox = api(netbox_host, token=netbox_token, threading=True) netbox = api(netbox_host, token=netbox_token, threading=True)
# Check if the provided Hostgroup layout is valid # Check if the provided Hostgroup layout is valid
hg_objects = hostgroup_format.split("/") hg_objects = hostgroup_format.split("/")
allowed_objects = ["dev_location", "role", "manufacturer", "region", allowed_objects = ["location", "role", "manufacturer", "region",
"site", "site_group", "tenant", "tenant_group"] "site", "site_group", "tenant", "tenant_group"]
# Create API call to get all custom fields which are on the device objects # Create API call to get all custom fields which are on the device objects
device_cfs = netbox.extras.custom_fields.filter(type="text", content_type_id=23) device_cfs = netbox.extras.custom_fields.filter(type="text", content_type_id=23)