40
40
from wlsdeploy .tool .util import filter_helper
41
41
from wlsdeploy .tool .util import model_context_helper
42
42
from wlsdeploy .tool .util import variable_injector_functions
43
- from wlsdeploy .tool .util .alias_helper import AliasHelper
44
43
from wlsdeploy .tool .util .variable_injector import VariableInjector
45
44
from wlsdeploy .tool .validate import validation_utils
46
45
from wlsdeploy .tool .validate .validator import Validator
@@ -108,8 +107,8 @@ def __init__(self, model_files, model_context, logger, output_dir=None):
108
107
self .model_files = model_files
109
108
self .output_dir = output_dir
110
109
self .model_context = model_context
111
- self ._aliases = Aliases (model_context = model_context , wlst_mode = WlstModes .OFFLINE )
112
- self . _alias_helper = AliasHelper ( self . _aliases , logger , ExceptionType .COMPARE )
110
+ self ._aliases = Aliases (model_context = model_context , wlst_mode = WlstModes .OFFLINE ,
111
+ exception_type = ExceptionType .COMPARE )
113
112
self ._logger = logger
114
113
self ._name_tokens_location = LocationContext ()
115
114
self ._name_tokens_location .add_name_token ('DOMAIN' , "testdomain" )
@@ -124,14 +123,14 @@ def __walk_model_section(self, model_section_key, model_dict, valid_section_fold
124
123
return
125
124
126
125
# only specific top-level sections have attributes
127
- attribute_location = self ._alias_helper .get_model_section_attribute_location (model_section_key )
126
+ attribute_location = self ._aliases .get_model_section_attribute_location (model_section_key )
128
127
129
128
valid_attr_infos = []
130
129
path_tokens_attr_keys = []
131
130
132
131
if attribute_location is not None :
133
- valid_attr_infos = self ._alias_helper .get_model_attribute_names_and_types (attribute_location )
134
- path_tokens_attr_keys = self ._alias_helper .get_model_uses_path_tokens_attribute_names (attribute_location )
132
+ valid_attr_infos = self ._aliases .get_model_attribute_names_and_types (attribute_location )
133
+ path_tokens_attr_keys = self ._aliases .get_model_uses_path_tokens_attribute_names (attribute_location )
135
134
136
135
model_section_dict = model_dict [model_section_key ]
137
136
for section_dict_key , section_dict_value in model_section_dict .iteritems ():
@@ -158,16 +157,16 @@ def __walk_model_section(self, model_section_key, model_dict, valid_section_fold
158
157
def __walk_section_folder (self , model_node , validation_location ):
159
158
_method_name = '__validate_section_folder'
160
159
161
- model_folder_path = self ._alias_helper .get_model_folder_path (validation_location )
160
+ model_folder_path = self ._aliases .get_model_folder_path (validation_location )
162
161
163
- if self ._alias_helper .supports_multiple_mbean_instances (validation_location ):
162
+ if self ._aliases .supports_multiple_mbean_instances (validation_location ):
164
163
165
164
for name in model_node :
166
165
expanded_name = name
167
166
168
167
new_location = LocationContext (validation_location )
169
168
170
- name_token = self ._alias_helper .get_name_token (new_location )
169
+ name_token = self ._aliases .get_name_token (new_location )
171
170
172
171
if name_token is not None :
173
172
new_location .add_name_token (name_token , expanded_name )
@@ -176,14 +175,14 @@ def __walk_section_folder(self, model_node, validation_location):
176
175
177
176
self .__walk_model_node (value_dict , new_location )
178
177
179
- elif self ._alias_helper .requires_artificial_type_subfolder_handling (validation_location ):
178
+ elif self ._aliases .requires_artificial_type_subfolder_handling (validation_location ):
180
179
181
180
for name in model_node :
182
181
expanded_name = name
183
182
184
183
new_location = LocationContext (validation_location )
185
184
186
- name_token = self ._alias_helper .get_name_token (new_location )
185
+ name_token = self ._aliases .get_name_token (new_location )
187
186
188
187
if name_token is not None :
189
188
new_location .add_name_token (name_token , expanded_name )
@@ -193,7 +192,7 @@ def __walk_section_folder(self, model_node, validation_location):
193
192
self .__walk_model_node (value_dict , new_location )
194
193
195
194
else :
196
- name_token = self ._alias_helper .get_name_token (validation_location )
195
+ name_token = self ._aliases .get_name_token (validation_location )
197
196
198
197
if name_token is not None :
199
198
name = self ._name_tokens_location .get_name_for_token (name_token )
@@ -208,18 +207,18 @@ def __walk_section_folder(self, model_node, validation_location):
208
207
def __walk_model_node (self , model_node , validation_location ):
209
208
_method_name = '__process_model_node'
210
209
211
- valid_folder_keys = self ._alias_helper .get_model_subfolder_names (validation_location )
212
- valid_attr_infos = self ._alias_helper .get_model_attribute_names_and_types (validation_location )
213
- model_folder_path = self ._alias_helper .get_model_folder_path (validation_location )
210
+ valid_folder_keys = self ._aliases .get_model_subfolder_names (validation_location )
211
+ valid_attr_infos = self ._aliases .get_model_attribute_names_and_types (validation_location )
212
+ model_folder_path = self ._aliases .get_model_folder_path (validation_location )
214
213
215
214
for key , value in model_node .iteritems ():
216
215
217
216
if key in valid_folder_keys :
218
217
new_location = LocationContext (validation_location ).append_location (key )
219
218
220
- if self ._alias_helper .is_artificial_type_folder (new_location ):
219
+ if self ._aliases .is_artificial_type_folder (new_location ):
221
220
# key is an ARTIFICIAL_TYPE folder
222
- valid_attr_infos = self ._alias_helper .get_model_attribute_names_and_types (new_location )
221
+ valid_attr_infos = self ._aliases .get_model_attribute_names_and_types (new_location )
223
222
224
223
self .__walk_attributes (value , valid_attr_infos , new_location )
225
224
else :
@@ -237,17 +236,17 @@ def __walk_model_node(self, model_node, validation_location):
237
236
238
237
else :
239
238
path_tokens_attr_keys = \
240
- self ._alias_helper .get_model_uses_path_tokens_attribute_names (validation_location )
239
+ self ._aliases .get_model_uses_path_tokens_attribute_names (validation_location )
241
240
242
241
self .__walk_attribute (key , value , valid_attr_infos , path_tokens_attr_keys , model_folder_path ,
243
242
validation_location )
244
243
245
244
def __walk_attributes (self , attributes_dict , valid_attr_infos , validation_location ):
246
245
_method_name = '__validate_attributes'
247
246
248
- path_tokens_attr_keys = self ._alias_helper .get_model_uses_path_tokens_attribute_names (validation_location )
247
+ path_tokens_attr_keys = self ._aliases .get_model_uses_path_tokens_attribute_names (validation_location )
249
248
250
- model_folder_path = self ._alias_helper .get_model_folder_path (validation_location )
249
+ model_folder_path = self ._aliases .get_model_folder_path (validation_location )
251
250
252
251
for attribute_name , attribute_value in attributes_dict .iteritems ():
253
252
self .__walk_attribute (attribute_name , attribute_value , valid_attr_infos , path_tokens_attr_keys ,
@@ -399,14 +398,14 @@ def walk(self):
399
398
self .cache [key ] = ''
400
399
401
400
# use a merged, substituted, filtered model to get domain name and create additional target output.
402
- full_model_dictionary = cla_helper .load_model (_program_name , self .model_context , self ._alias_helper ,
401
+ full_model_dictionary = cla_helper .load_model (_program_name , self .model_context , self ._aliases ,
403
402
"discover" , WlstModes .OFFLINE )
404
403
405
404
target_configuration_helper .generate_k8s_script (self .model_context , self .cache , full_model_dictionary )
406
405
407
406
# create any additional outputs from full model dictionary
408
407
target_configuration_helper .create_additional_output (Model (full_model_dictionary ), self .model_context ,
409
- self ._alias_helper , ExceptionType .VALIDATE )
408
+ self ._aliases , ExceptionType .VALIDATE )
410
409
411
410
except ValidateException , te :
412
411
self ._logger .severe ('WLSDPLY-20009' , _program_name , model_file_name , te .getLocalizedMessage (),
0 commit comments