mirror of
https://github.com/bb-Ricardo/netbox-sync.git
synced 2026-05-08 11:00:12 -05:00
added <NONE> as an option for scope type in config
This commit is contained in:
@@ -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)
|
||||
""",
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user