@@ -548,6 +548,8 @@ def __validate_section_folder(self, model_node, validation_location):
548
548
549
549
def __process_model_node (self , model_node , validation_location ):
550
550
_method_name = '__process_model_node'
551
+ self ._logger .entering (str_helper .to_string (validation_location ),
552
+ class_name = _class_name , method_name = _method_name )
551
553
552
554
model_folder_path = self ._aliases .get_model_folder_path (validation_location )
553
555
@@ -574,7 +576,12 @@ def __process_model_node(self, model_node, validation_location):
574
576
self ._logger .finer ('key={0}' , key ,
575
577
class_name = _class_name , method_name = _method_name )
576
578
577
- if key in valid_folder_keys :
579
+ folder_validation_code , folder_validation_message = \
580
+ self ._aliases .is_valid_model_folder_name (validation_location , key )
581
+ attribute_validation_code , attribute_validation_message = \
582
+ self ._aliases .is_valid_model_attribute_name (validation_location , key )
583
+
584
+ if folder_validation_code == ValidationCodes .VALID :
578
585
new_location = LocationContext (validation_location ).append_location (key )
579
586
self ._logger .finer ('new_location={0}' , new_location ,
580
587
class_name = _class_name , method_name = _method_name )
@@ -588,8 +595,7 @@ def __process_model_node(self, model_node, validation_location):
588
595
self .__validate_attributes (value , valid_attr_infos , new_location )
589
596
else :
590
597
self .__validate_section_folder (value , new_location )
591
-
592
- elif key in valid_attr_infos :
598
+ elif attribute_validation_code == ValidationCodes .VALID :
593
599
# aliases.get_model_attribute_names_and_types(location) filters out
594
600
# attributes that ARE NOT valid in the wlst_version being used, so if
595
601
# we're in this section of code we know key is a bonafide "valid" attribute
@@ -605,7 +611,10 @@ def __process_model_node(self, model_node, validation_location):
605
611
606
612
self .__validate_attribute (key , value , valid_attr_infos , path_tokens_attr_keys , model_folder_path ,
607
613
validation_location )
608
-
614
+ elif folder_validation_code == ValidationCodes .CONTEXT_INVALID :
615
+ self ._log_context_invalid (folder_validation_message , _method_name )
616
+ elif attribute_validation_code == ValidationCodes .CONTEXT_INVALID :
617
+ self ._log_context_invalid (attribute_validation_message , _method_name )
609
618
elif self ._aliases .is_custom_folder_allowed (validation_location ):
610
619
# custom folders are not validated, just log this and continue
611
620
self ._logger .info ('WLSDPLY-05037' , model_folder_path ,
@@ -623,10 +632,7 @@ def __process_model_node(self, model_node, validation_location):
623
632
# method pulls those out, in the self.__validate_section_folder().
624
633
625
634
# See if it's a version invalid folder
626
- result , message = self ._aliases .is_valid_model_folder_name (validation_location , key )
627
- if result == ValidationCodes .CONTEXT_INVALID :
628
- self ._log_context_invalid (message , _method_name )
629
- elif result == ValidationCodes .INVALID :
635
+ if folder_validation_code == ValidationCodes .INVALID :
630
636
# key is an INVALID folder
631
637
self ._logger .severe ('WLSDPLY-05026' , key , 'folder' , model_folder_path ,
632
638
'%s' % ', ' .join (valid_folder_keys ), class_name = _class_name ,
@@ -637,10 +643,7 @@ def __process_model_node(self, model_node, validation_location):
637
643
# method pulls those out, in the self.__validate_section_folder().
638
644
639
645
# See if it's a version invalid attribute
640
- result , message = self ._aliases .is_valid_model_attribute_name (validation_location , key )
641
- if result == ValidationCodes .CONTEXT_INVALID :
642
- self ._log_context_invalid (message , _method_name )
643
- elif result == ValidationCodes .INVALID :
646
+ if attribute_validation_code == ValidationCodes .INVALID :
644
647
# key is an INVALID attribute
645
648
self ._logger .severe ('WLSDPLY-05029' , key , model_folder_path ,
646
649
'%s' % ', ' .join (valid_attr_infos ), class_name = _class_name ,
0 commit comments