File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ class OnboardingConfig(PluginConfig):
3333 "create_device_type_if_missing" : True ,
3434 "create_device_role_if_missing" : True ,
3535 "default_device_role" : "network" ,
36+ "default_management_interface" : "PLACEHOLDER" ,
37+ "default_management_prefix_length" : 0 ,
3638 }
3739 caching_config = {}
3840
Original file line number Diff line number Diff line change @@ -195,7 +195,11 @@ def get_platform_object_from_netbox(platform_slug):
195195
196196 return platform
197197
198- def get_required_info (self ):
198+ def get_required_info (
199+ self ,
200+ default_mgmt_if = PLUGIN_SETTINGS ["default_management_interface" ],
201+ default_mgmt_pfxlen = PLUGIN_SETTINGS ["default_management_prefix_length" ],
202+ ):
199203 """Gather information from the network device that is needed to onboard the device into the NetBox system.
200204
201205 Raises:
@@ -259,7 +263,7 @@ def get_mgmt_info():
259263 for if_addr , if_addr_data in if_data ["ipv4" ].items ():
260264 if if_addr == mgmt_ipaddr :
261265 return (if_name , if_addr_data ["prefix_length" ])
262- return ("PLACEHOLDER" , 0 )
266+ return (default_mgmt_if , default_mgmt_pfxlen )
263267
264268 mgmt_ifname , mgmt_pflen = get_mgmt_info ()
265269
You can’t perform that action at this time.
0 commit comments