@@ -2069,14 +2069,15 @@ def get_diff_replace(self):
2069
2069
for vrf in all_vrfs :
2070
2070
# If the playbook sets the deploy key to False, then we need to remove the vrf from the deploy list.
2071
2071
want_vrf_data = find_dict_in_list_by_key_value (search = self .config , key = "vrf_name" , value = vrf )
2072
- if want_vrf_data [ 'deploy' ] is False :
2072
+ if want_vrf_data . get ( 'deploy' , True ) is False :
2073
2073
modified_all_vrfs .remove (vrf )
2074
2074
2075
- if not self .diff_deploy :
2076
- diff_deploy .update ({"vrfNames" : "," .join (modified_all_vrfs )})
2077
- else :
2078
- vrfs = self .diff_deploy ["vrfNames" ] + "," + "," .join (modified_all_vrfs )
2079
- diff_deploy .update ({"vrfNames" : vrfs })
2075
+ if modified_all_vrfs :
2076
+ if not diff_deploy :
2077
+ diff_deploy .update ({"vrfNames" : "," .join (modified_all_vrfs )})
2078
+ else :
2079
+ vrfs = self .diff_deploy ["vrfNames" ] + "," + "," .join (modified_all_vrfs )
2080
+ diff_deploy .update ({"vrfNames" : vrfs })
2080
2081
2081
2082
self .diff_attach = copy .deepcopy (diff_attach )
2082
2083
self .diff_deploy = copy .deepcopy (diff_deploy )
@@ -2380,11 +2381,15 @@ def diff_merge_attach(self, replace=False):
2380
2381
for vrf in all_vrfs :
2381
2382
# If the playbook sets the deploy key to False, then we need to remove the vrf from the deploy list.
2382
2383
want_vrf_data = find_dict_in_list_by_key_value (search = self .config , key = "vrf_name" , value = vrf )
2383
- if want_vrf_data [ ' deploy' ] is False :
2384
+ if want_vrf_data . get ( " deploy" , True ) is False :
2384
2385
modified_all_vrfs .remove (vrf )
2385
2386
2386
- if len (modified_all_vrfs ) != 0 :
2387
- diff_deploy .update ({"vrfNames" : "," .join (all_vrfs )})
2387
+ if modified_all_vrfs :
2388
+ if not diff_deploy :
2389
+ diff_deploy .update ({"vrfNames" : "," .join (modified_all_vrfs )})
2390
+ else :
2391
+ vrfs = self .diff_deploy ["vrfNames" ] + "," + "," .join (modified_all_vrfs )
2392
+ diff_deploy .update ({"vrfNames" : vrfs })
2388
2393
2389
2394
self .diff_attach = diff_attach
2390
2395
self .diff_deploy = diff_deploy
0 commit comments