Skip to content

Commit 5f173f9

Browse files
committed
Renamed variables, corrected comments
1 parent 154feb2 commit 5f173f9

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

core/src/test/python/wlsdeploy/tool/extract/kubernetes_schema_test.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,18 @@ def testKubernetesSchema(self):
3232
self._write_line(KUBERNETES + ":")
3333
self._write_folder(self.schema_map, False, "", " ")
3434

35-
def _write_folder(self, folder, is_multiple, path, indent):
36-
# for a multiple (object list) type, the first field is prefixed with a hyphen
37-
plain_indent = indent
38-
hyphen_indent = indent[:-2] + "- "
39-
this_indent = plain_indent
40-
if is_multiple:
41-
this_indent = hyphen_indent
35+
def _write_folder(self, folder, in_array, path, indent):
36+
# for an object in an array, the first field is prefixed with a hyphen
37+
this_indent = plain_indent = indent
38+
if in_array:
39+
this_indent = indent[:-2] + "- "
4240

4341
properties = wko_schema_helper.get_properties(folder)
4442
property_names = list(properties.keys())
4543
property_names.sort()
4644

4745
sub_folders = PyOrderedDict()
48-
multi_sub_folders = []
46+
object_array_keys = []
4947
for property_name in property_names:
5048
property_map = properties[property_name]
5149
property_type = wko_schema_helper.get_type(property_map)
@@ -67,7 +65,7 @@ def _write_folder(self, folder, is_multiple, path, indent):
6765
elif wko_schema_helper.is_object_array(property_map):
6866
array_items = wko_schema_helper.get_array_item_info(property_map)
6967
sub_folders[property_name] = array_items
70-
multi_sub_folders.append(property_name)
68+
object_array_keys.append(property_name)
7169

7270
elif wko_schema_helper.is_simple_array(property_map):
7371
array_type = wko_schema_helper.get_array_element_type(property_map)
@@ -98,9 +96,9 @@ def _write_folder(self, folder, is_multiple, path, indent):
9896
self._write_line(this_indent + property_name + ":")
9997
this_indent = plain_indent
10098
subfolder = sub_folders[property_name]
101-
is_multiple = property_name in multi_sub_folders
99+
in_array = property_name in object_array_keys
102100
child_indent = this_indent + " "
103-
self._write_folder(subfolder, is_multiple, next_path, child_indent)
101+
self._write_folder(subfolder, in_array, next_path, child_indent)
104102

105103
def _write_line(self, text):
106104
self.out_file.write(text + "\n")

0 commit comments

Comments
 (0)