@@ -19,7 +19,7 @@ def get_rrset(zone_data,dns_client,record_default):
19
19
zone_records = oci .pagination .list_call_get_all_results (dns_client .get_zone_records ,zone_data .id ).data
20
20
21
21
for zone_record in zone_records .items :
22
- if record_default == 'n' and zone_record .is_protected == True :
22
+ if ( record_default == 'n' and zone_record .is_protected == True ) or zone_record . rtype in [ "SOA" , "NS" ] :
23
23
continue
24
24
tmpdict = {}
25
25
domain = zone_record .domain
@@ -75,7 +75,7 @@ def print_data(region, ntk_compartment_name, rrset, zone_data, view_data, values
75
75
values_for_column = commonTools .export_tags (view_data , col_header , values_for_column )
76
76
77
77
78
- def print_empty_view (region , ntk_compartment_name , view_data , values_for_column ):
78
+ def print_empty_view (region , ntk_compartment_name , view_data , values_for_column , zone_name = "" ):
79
79
for col_header in values_for_column :
80
80
if col_header == 'Region' :
81
81
values_for_column [col_header ].append (region )
@@ -85,7 +85,7 @@ def print_empty_view(region, ntk_compartment_name, view_data, values_for_column)
85
85
values_for_column [col_header ].append (view_data .display_name )
86
86
87
87
elif col_header == 'Zone' :
88
- values_for_column [col_header ].append ("" )
88
+ values_for_column [col_header ].append (zone_name )
89
89
elif col_header == 'Domain' :
90
90
values_for_column [col_header ].append ("" )
91
91
elif col_header == 'RType' :
@@ -214,12 +214,15 @@ def export_dns_views_zones_rrsets(inputfile, outdir, service_dir, config, signer
214
214
if rrsets :
215
215
for rrset in rrsets .values ():
216
216
print_data (region , ntk_compartment_name , rrset , zone_data , view_data , values_for_column ,state )
217
- tf_resource = f'module.dns-zones[\\ "{ zone_tf_name } \\ "].oci_dns_zone.zone'
218
- if tf_resource not in state ["resources" ]:
219
- importCommands [region .lower ()] += f'\n { tf_or_tofu } import "{ tf_resource } " { str (zone_data .id )} '
220
217
221
218
else :
222
- print_empty_view (region , ntk_compartment_name , view_data , values_for_column )
219
+ print_empty_view (region , ntk_compartment_name , view_data , values_for_column ,zone_name = zone_data .name )
220
+
221
+ tf_resource = f'module.dns-zones[\\ "{ zone_tf_name } \\ "].oci_dns_zone.zone'
222
+ if tf_resource not in state ["resources" ]:
223
+ importCommands [
224
+ region .lower ()] += f'\n { tf_or_tofu } import "{ tf_resource } " { str (zone_data .id )} '
225
+
223
226
else :
224
227
print_empty_view (region , ntk_compartment_name , view_data , values_for_column )
225
228
if print_zone == False :
0 commit comments