added <NONE> as an option for scope type in config

This commit is contained in:
Noah
2025-08-22 15:36:59 +10:00
committed by Andrew Foster
parent ac5c334205
commit 0625c3c2d9
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -148,6 +148,7 @@ class VMWareConfig(ConfigBase):
description="""This option defines the scope type for a cluster.
The scope type can be 'dcim.site', 'dcim.sitegroup', 'dcim.location' or 'dcim.region'.
This is done with a comma separated key = value list.
Can be set to "<NONE>" to not assign a scope type.
key: defines a cluster name as regex
value: defines the NetBox scope type name (use quotes if name contains commas)
""",
@@ -157,6 +158,7 @@ class VMWareConfig(ConfigBase):
description="""This option defines the scope id for a cluster.
The scope id is the NetBox ID of the scope type.
This is done with a comma separated key = value list.
To be used in combination with the 'cluster_scope_type_relation'.
key: defines a cluster name as regex
value: defines the NetBox scope id (use quotes if name contains commas)
""",
+5
View File
@@ -540,6 +540,11 @@ class VMWareHandler(SourceBase):
if type(scope_type) is not str:
log.debug(f"scope_type is type: {type(scope_type)}, not str")
return None
if scope_type == "<NONE>":
log.debug(f"Scope type for {object_type.name} '{object_name}' is set to None")
return None
log.debug(f"Returning scope type '{scope_type}' for {object_type.name} '{object_name}'. End of method.")
return scope_type