File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3376,11 +3376,39 @@ def get_diff_tagging(self):
33763376 self .log ("Product name ordinal: {0}" .format (product_name_ordinal ), "DEBUG" )
33773377
33783378 device_tags = tagging_details .get ("device_tags" , [])
3379+ if not device_tags :
3380+ self .log (
3381+ "No 'device_tags' provided in tagging_details. "
3382+ "Proceeding with golden tagging without device-tag filtering." ,
3383+ "DEBUG" ,
3384+ )
3385+ else :
3386+ self .log (
3387+ "Resolving {0} device tag(s) from tagging_details: {1}" .format (
3388+ len (device_tags ), device_tags
3389+ ),
3390+ "DEBUG" ,
3391+ )
3392+
33793393 device_tags_ids = []
33803394 for device_tag in device_tags :
33813395 self .log ("Device tag to be applied: {0}" .format (device_tag ), "DEBUG" )
33823396 device_tags_id = self .get_network_device_tag_id (device_tag )
3397+ if not device_tags_id :
3398+ self .log (
3399+ "Device tag '{0}' could not be resolved to an ID in Cisco Catalyst Center "
3400+ "and will be skipped." .format (device_tag ),
3401+ "WARNING" ,
3402+ )
3403+ continue
3404+
33833405 device_tags_ids .append (device_tags_id )
3406+
3407+ self .log (
3408+ "Resolved device tag IDs for payload: {0}" .format (device_tags_ids ),
3409+ "DEBUG" ,
3410+ )
3411+
33843412 # -----------------------------------------------------
33853413 # STEP 4: Build payload
33863414 # -----------------------------------------------------
You can’t perform that action at this time.
0 commit comments