Describe the bug
When importing nsx configuration into sddc, import_flex_segments function imports multiple times the segment as the code flex_segment_import_exclude_list has indentation code issue
Reproduction steps
- import the nsx configuration
- check the output logs when importing the flex segments
- "error_message" : "Cannot create an object with path=[/infra/segments/seg-aaa-db] as it already exists."
...
Expected behavior
import only one time the segment and do not tries to import multiple times
Additional context
Error is in the VMCImportExport.py file code line 1246. Indentation is not correct as the segment put code is inside the flex_segment_import_exclude_list loop.
if skip_network is True code must be at the same level as for e in self.flex_segment_import_exclude_list:
Curent code is the following
for f in flex_segments:
skip_network = False
for e in self.flex_segment_import_exclude_list:
m = re.match(e,f['display_name'])
if m:
print(f"{f['display_name']}, skipped - matches excluseion regex")
skip_network = True
break
if skip_network is True:
continue
result = ""
result_note = ""
json_data = {}
it must be the following
for f in flex_segments:
skip_network = False
for e in self.flex_segment_import_exclude_list:
m = re.match(e,f['display_name'])
if m:
print(f"{f['display_name']}, skipped - matches excluseion regex")
skip_network = True
break
if skip_network is True:
continue
result = ""
result_note = ""
json_data = {}
Describe the bug
When importing nsx configuration into sddc, import_flex_segments function imports multiple times the segment as the code flex_segment_import_exclude_list has indentation code issue
Reproduction steps
...
Expected behavior
import only one time the segment and do not tries to import multiple times
Additional context
Error is in the VMCImportExport.py file code line 1246. Indentation is not correct as the segment put code is inside the flex_segment_import_exclude_list loop.
if skip_network is Truecode must be at the same level asfor e in self.flex_segment_import_exclude_list:Curent code is the following
it must be the following