Skip to content

Commit a4334bd

Browse files
committed
Rename methods, remove unused code
1 parent 14b1575 commit a4334bd

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

core/src/main/python/wlsdeploy/tool/extract/domain_resource_extractor.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@
5050
DEFAULT_IMAGE_PULL_SECRETS = PASSWORD_TOKEN
5151
DEFAULT_SOURCE_TYPE = 'Image'
5252

53-
MULTI_KEYS = {
54-
'spec/adminServer/adminService/channels': 'channelName',
55-
'spec/clusters': 'clusterName'
56-
}
57-
5853
_secret_pattern = re.compile("@@SECRET:([\\w.-]+):[\\w.-]+@@")
5954

6055

@@ -107,10 +102,10 @@ def _create_domain_resource_dictionary(self):
107102

108103
schema = wko_schema_helper.get_domain_resource_schema(ExceptionType.DEPLOY)
109104

110-
self._process_folder(kubernetes_map, schema, resource_dict, None)
105+
self._process_object(kubernetes_map, schema, resource_dict, None)
111106
return resource_dict
112107

113-
def _process_folder(self, model_dict, schema_folder, target_dict, schema_path):
108+
def _process_object(self, model_dict, schema_folder, target_dict, schema_path):
114109
"""
115110
Transfer folders and attributes from the model dictionary to the target domain resource dictionary.
116111
:param model_dict: the source model dictionary
@@ -128,14 +123,14 @@ def _process_folder(self, model_dict, schema_folder, target_dict, schema_path):
128123
if not wko_schema_helper.is_unsupported_folder(next_schema_path):
129124
next_target_dict = PyOrderedDict()
130125
target_dict[key] = next_target_dict
131-
self._process_folder(model_value, properties, next_target_dict, next_schema_path)
126+
self._process_object(model_value, properties, next_target_dict, next_schema_path)
132127

133128
elif wko_schema_helper.is_object_array(properties):
134129
next_schema_path = wko_schema_helper.append_path(schema_path, key)
135130
if not wko_schema_helper.is_unsupported_folder(next_schema_path):
136131
item_info = wko_schema_helper.get_array_item_info(properties)
137132
target_dict[key] = \
138-
self._process_multiple_folder(model_value, item_info, next_schema_path)
133+
self._process_object_array(model_value, item_info, next_schema_path)
139134

140135
elif wko_schema_helper.is_simple_map(properties):
141136
# map of key / value pairs
@@ -146,18 +141,17 @@ def _process_folder(self, model_dict, schema_folder, target_dict, schema_path):
146141
property_type = wko_schema_helper.get_type(properties)
147142
target_dict[key] = _get_target_value(model_value, property_type)
148143

149-
def _process_multiple_folder(self, model_value, item_info, schema_path):
144+
def _process_object_array(self, model_value, item_info, schema_path):
150145
"""
151-
Process a multiple-element model section.
152-
There should be a list of objects, each representing a sub-folder.
146+
Process an array of objects.
153147
:param model_value: the model contents for a folder
154148
:param item_info: describes the contents of the sub-folder for each element
155149
:param schema_path: the path of schema elements (no multi-element names), used for supported check
156150
"""
157151
child_list = list()
158-
for name_map in model_value:
152+
for object_map in model_value:
159153
next_target_dict = PyOrderedDict()
160-
self._process_folder(name_map, item_info, next_target_dict, schema_path)
154+
self._process_object(object_map, item_info, next_target_dict, schema_path)
161155
child_list.append(next_target_dict)
162156
return child_list
163157

0 commit comments

Comments
 (0)