5252REGEXP_SUFFIX = 'suffix'
5353REGEXP_PATTERN = 'pattern'
5454FORCE = 'force'
55+ VARIABLE_VALUE = 'variable_value'
5556
5657VARIABLE_SEP = '.'
5758SUFFIX_SEP = '--'
@@ -280,11 +281,11 @@ def __format_variable_name_segment(self, location, attribute, suffix):
280281 def _variable_info (self , model , attribute , location , injector_values ):
281282 # add code here to put in model if force in injector values
282283 if REGEXP in injector_values :
283- return self ._process_regexp (model , attribute , location , injector_values [ REGEXP ] )
284+ return self ._process_regexp (model , attribute , location , injector_values )
284285 else :
285- return self ._process_attribute (model , attribute , location )
286+ return self ._process_attribute (model , attribute , location , injector_values )
286287
287- def _process_attribute (self , model , attribute , location ):
288+ def _process_attribute (self , model , attribute , location , injector_values ):
288289 _method_name = '_process_attribute'
289290 _logger .entering (attribute , location .get_folder_path (), class_name = _class_name ,
290291 method_name = _method_name )
@@ -302,20 +303,22 @@ def _process_attribute(self, model, attribute, location):
302303 _logger .finer ('WLSDPLY-19526' , attribute_value , attribute , str (location ), class_name = _class_name ,
303304 method_name = _method_name )
304305 if variable_value :
305- variable_dict [variable_name ] = variable_value
306+ variable_dict [variable_name ] = self ._check_replace_variable_value (location , attribute , variable_value ,
307+ injector_values )
306308 _logger .exiting (class_name = _class_name , method_name = _method_name , result = variable_value )
307309 return variable_dict
308310
309- def _process_regexp (self , model , attribute , location , regexp_list ):
311+ def _process_regexp (self , model , attribute , location , injector_values ):
310312 if isinstance (model [attribute ], dict ):
311- return self ._process_patterns_dictionary (attribute , model [attribute ], location , regexp_list )
313+ return self ._process_patterns_dictionary (attribute , model [attribute ], location , injector_values )
312314 elif type (model [attribute ]) == list :
313- return self ._process_patterns_list (attribute , model [attribute ], location , regexp_list )
315+ return self ._process_patterns_list (attribute , model [attribute ], location , injector_values )
314316 else :
315- return self ._process_patterns_string (model , attribute , location , regexp_list )
317+ return self ._process_patterns_string (model , attribute , location , injector_values )
316318
317- def _process_patterns_string (self , model , attribute , location , regexp_list ):
319+ def _process_patterns_string (self , model , attribute , location , injector_values ):
318320 variable_dict = dict ()
321+ regexp_list = injector_values [REGEXP ]
319322 for dictionary in regexp_list :
320323 pattern = None
321324 suffix = None
@@ -325,7 +328,8 @@ def _process_patterns_string(self, model, attribute, location, regexp_list):
325328 suffix = dictionary [REGEXP_SUFFIX ]
326329 variable_name , variable_value = self ._process_pattern_string (model , attribute , location , pattern , suffix )
327330 if variable_value :
328- variable_dict [variable_name ] = variable_value
331+ variable_dict [variable_name ] = self ._check_replace_variable_value (location , attribute , variable_value ,
332+ injector_values )
329333 return variable_dict
330334
331335 def _process_pattern_string (self , model , attribute , location , pattern , suffix ):
@@ -350,6 +354,7 @@ def _process_pattern_string(self, model, attribute, location, pattern, suffix):
350354 _logger .finer ('WLSDPLY-19524' , pattern , attribute , model [attribute ],
351355 location .get_folder_path , class_name = _class_name ,
352356 method_name = _method_name )
357+
353358 _logger .exiting (class_name = _class_name , method_name = _method_name , result = variable_value )
354359 return variable_name , variable_value
355360
@@ -362,8 +367,9 @@ def _find_segment_in_string(self, attribute, attribute_value, location, pattern,
362367 _format_as_property (variable_name ))
363368 return attribute_value , variable_name , variable_value
364369
365- def _process_patterns_list (self , attribute , attribute_value , location , regexp_list ):
370+ def _process_patterns_list (self , attribute , attribute_value , location , injector_values ):
366371 variable_dict = dict ()
372+ regexp_list = injector_values [REGEXP ]
367373 for dictionary in regexp_list :
368374 pattern = None
369375 suffix = None
@@ -374,7 +380,8 @@ def _process_patterns_list(self, attribute, attribute_value, location, regexp_li
374380 variable_name , variable_value = self ._process_pattern_list (attribute , attribute_value , location , pattern ,
375381 suffix )
376382 if variable_value :
377- variable_dict [variable_name ] = variable_value
383+ variable_dict [variable_name ] = self ._check_replace_variable_value (location , attribute , variable_value ,
384+ injector_values )
378385 return variable_dict
379386
380387 def _process_pattern_list (self , attribute_name , attribute_list , location , pattern , suffix ):
@@ -399,8 +406,9 @@ def _process_pattern_list(self, attribute_name, attribute_list, location, patter
399406 _logger .exiting (class_name = _class_name , method_name = _method_name , result = variable_value )
400407 return variable_name , variable_value
401408
402- def _process_patterns_dictionary (self , attribute , attribute_dict , location , regexp_list ):
409+ def _process_patterns_dictionary (self , attribute , attribute_dict , location , injector_values ):
403410 variable_dict = dict ()
411+ regexp_list = injector_values [REGEXP ]
404412 for dictionary in regexp_list :
405413 pattern = None
406414 suffix = None
@@ -411,7 +419,8 @@ def _process_patterns_dictionary(self, attribute, attribute_dict, location, rege
411419 variable_name , variable_value = self ._process_pattern_dictionary (attribute , attribute_dict , location ,
412420 pattern , suffix )
413421 if variable_value :
414- variable_dict [variable_name ] = variable_value
422+ variable_dict [variable_name ] = self ._check_replace_variable_value (location , attribute , variable_value ,
423+ injector_values )
415424 return variable_dict
416425
417426 def _process_pattern_dictionary (self , attribute_name , attribute_dict , location , regexp , suffix ):
@@ -497,9 +506,12 @@ def _find_special_name(self, mbean):
497506 mbean_name = mbean
498507 mbean_name_list = []
499508 name_list = _find_special_names_pattern .split (mbean )
509+ print 'mbean before split ' , mbean
510+ print 'after pattern split ' , name_list
500511 if name_list and len (name_list ) > 1 :
501512 mbean_name = name_list [0 ]
502513 mbean_name_list = name_list [1 ].split (',' )
514+ print 'after second split ' , mbean_name_list
503515 if mbean_name_list :
504516 new_list = []
505517 for entry in mbean_name_list :
@@ -516,6 +528,7 @@ def _find_special_name(self, mbean):
516528 else :
517529 new_list .append (entry )
518530 mbean_name_list = new_list
531+ print 'mbean ' , mbean_name , ' mbean_name_list ' , mbean_name_list
519532 return mbean_name , mbean_name_list
520533
521534 def _check_insert_attribute_model (self , location , model_section , attribute , injector_values ):
@@ -528,6 +541,21 @@ def _check_insert_attribute_model(self, location, model_section, attribute, inje
528541 class_name = _class_name , method_name = _method_name )
529542 model_section [attribute ] = wlst_value
530543
544+ def _check_replace_variable_value (self , location , attribute , variable_value , injector_values ):
545+ _method_name = '_format_variable_value'
546+ if VARIABLE_VALUE in injector_values :
547+ value = injector_values [VARIABLE_VALUE ]
548+ # might add code to call a method to populate the replacement value
549+ try :
550+ self .__aliases .get_wlst_attribute_name_and_value (location , attribute , value )
551+ variable_value = value
552+ _logger .fine ('WLSDPLY-19542' , value , variable_value , attribute , location .get_folder_path (),
553+ class_name = _class_name , method_name = _method_name )
554+ except AliasException , ae :
555+ _logger .warning ('WLSDPLY-19541' , value , attribute , location , ae .getLocalizedMessage (),
556+ class_name = _class_name , method_name = _method_name )
557+ return variable_value
558+
531559
532560def _load_variable_file (variable_file_location , ** kwargs ):
533561 _method_name = '_load_variable_file'
@@ -705,6 +733,7 @@ def _format_as_property(prop_name):
705733 return '@@PROP:%s@@' % prop_name
706734
707735
736+
708737def _split_injector (injector_path ):
709738 """
710739 Split the injector path into an mbean list and an attribute name from the injector path string
0 commit comments