Skip to content

Commit ac5c334

Browse files
Noah418afoster
authored andcommitted
Added dcim.location and dcim.region as valid options for scope type in config
1 parent 6cd5708 commit ac5c334

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

module/netbox/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
NBTenant,
1818
NBSite,
1919
NBSiteGroup,
20+
NBRegion,
21+
NBLocation,
2022
NBVRF,
2123
NBVLAN,
2224
NBVLANList,

module/netbox/object_classes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ def update(self, data=None, read_from_netbox=False, source=None):
563563

564564
# check data model to see how we have to parse the value
565565
defined_value_type = self.data_model.get(key)
566-
567566
# value must be a string witch a certain max length
568567
if isinstance(defined_value_type, int):
569568
if not isinstance(value, str):
@@ -587,7 +586,7 @@ def update(self, data=None, read_from_netbox=False, source=None):
587586

588587
# check if value is in defined list
589588
elif value not in defined_value_type:
590-
log.error(f"Invalid data type for '{key}' (must be one of {defined_value_type}), got: '{value}'")
589+
log.error(f"this one. Invalid data type for '{key}' (must be one of {defined_value_type}), got: '{value}'")
591590
continue
592591

593592
# just check the type of the value
@@ -1890,7 +1889,7 @@ class NBCluster(NetBoxObject):
18901889
def __init__(self, *args, **kwargs):
18911890
self.mapping = NetBoxMappings()
18921891
self.scopes = [
1893-
NBSite, NBSiteGroup
1892+
NBSite, NBSiteGroup, NBLocation, NBRegion
18941893
]
18951894
self.data_model = {
18961895
"name": 100,
@@ -1899,7 +1898,6 @@ def __init__(self, *args, **kwargs):
18991898
"tenant": NBTenant,
19001899
"group": NBClusterGroup,
19011900
"scope_type": self.mapping.scopes_object_types(self.scopes),
1902-
# currently only site is supported as a scope
19031901
"scope_id": NetBoxObject,
19041902
"site": NBSite,
19051903
"tags": NBTagList

module/sources/vmware/connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class VMWareHandler(SourceBase):
6262
NBDeviceRole,
6363
NBSite,
6464
NBSiteGroup,
65+
NBLocation,
66+
NBRegion,
6567
NBCluster,
6668
NBDevice,
6769
NBVM,

0 commit comments

Comments
 (0)