@@ -94,12 +94,19 @@ def _populate_model_parameters(self, dictionary, location):
94
94
class_name = _class_name , method_name = _method_name )
95
95
if wlst_extra_params is not None :
96
96
for wlst_extra_param in wlst_extra_params :
97
- if wlst_extra_param not in wlst_get_params :
98
- _logger .info ('WLSDPLY-06148' , wlst_extra_param , str (location ),
97
+ if wlst_extra_param in wlst_get_params :
98
+ success , wlst_value = self ._get_attribute_value_with_get (wlst_extra_param , wlst_path )
99
+ if success :
100
+ self ._add_to_dictionary (dictionary , location , wlst_extra_param , wlst_value , wlst_path )
101
+ else :
102
+ _logger .info ('WLSDPLY-06152' , wlst_extra_param , location .get_folder_path (),
103
+ class_name = _class_name , method_name = _method_name )
104
+ elif self ._is_defined_attribute (location , wlst_extra_param ):
105
+ _logger .info ('WLSDPLY-06154' , wlst_extra_param , location .get_folder_path (),
106
+ class_name = _class_name , method_name = _method_name )
107
+ else :
108
+ _logger .info ('WLSDPLY-06153' , wlst_extra_param , location .get_folder_path (),
99
109
class_name = _class_name , method_name = _method_name )
100
- success , wlst_value = self ._get_attribute_value_with_get (wlst_extra_param , wlst_path )
101
- if success :
102
- self ._add_to_dictionary (dictionary , location , wlst_extra_param , wlst_value , wlst_path )
103
110
104
111
def _get_attribute_value_with_get (self , wlst_get_param , wlst_path ):
105
112
_method_name = '_get_attribute_value_with_get'
@@ -142,13 +149,7 @@ def _get_attributes_for_current_location(self, location):
142
149
:param location: context with the current location information
143
150
:return: list of attributes
144
151
"""
145
- if self ._wlst_mode == WlstModes .OFFLINE :
146
- return self ._get_attributes_for_current_location_offline (location )
147
- else :
148
- return self ._get_attributes_for_current_location_online (location )
149
-
150
- def _get_attributes_for_current_location_offline (self , location ):
151
- _method_name = '_get_attributes_for_current_location_offline'
152
+ _method_name = '_get_attributes_for_current_location'
152
153
attributes = []
153
154
path = self ._alias_helper .get_wlst_attributes_path (location )
154
155
try :
@@ -159,37 +160,12 @@ def _get_attributes_for_current_location_offline(self, location):
159
160
method_name = _method_name )
160
161
return attributes
161
162
162
- def _get_attributes_for_current_location_online (self , location ):
163
- _method_name = '_get_attributes_for_current_location_online'
164
- lsa_attributes = dict ()
165
- path = self ._alias_helper .get_wlst_attributes_path (location )
166
- try :
167
- lsa_attributes = wlst_helper .lsa (path )
168
- mbi_attributes = _get_mbi_attribute_list (path )
169
- if mbi_attributes :
170
- for lsa_attribute_name in lsa_attributes :
171
- if lsa_attribute_name in lsa_attributes and lsa_attribute_name not in mbi_attributes :
172
- _logger .finer ('WLSDPLY-06142' , lsa_attribute_name )
173
- del lsa_attributes [lsa_attribute_name ]
174
- for mbi_attribute_name in mbi_attributes :
175
- if mbi_attribute_name not in lsa_attributes and mbi_attribute_name in mbi_attributes :
176
- # don't count on the item in the get required list in caller, just get the value
177
- # and add it to our lsa list
178
- _logger .finer ('WLSDPLY-06141' , mbi_attribute_name , class_name = _class_name ,
179
- method_name = _method_name )
180
- lsa_attributes [mbi_attribute_name ] = wlst_helper .get (mbi_attribute_name )
181
- except PyWLSTException , pe :
182
- name = location .get_model_folders ()[- 1 ]
183
- _logger .fine ('WLSDPLY-06109' , name , str (location ), pe .getLocalizedMessage (), class_name = _class_name ,
184
- method_name = _method_name )
185
- return lsa_attributes
186
-
187
163
def _is_defined_attribute (self , location , wlst_name ):
188
164
attribute = False
189
165
try :
190
- if self ._aliases .get_model_attribute_name (location , wlst_name ):
166
+ if self ._alias_helper .get_model_attribute_name (location , wlst_name , check_read_only = False ):
191
167
attribute = True
192
- except AliasException :
168
+ except DiscoverException , de :
193
169
pass
194
170
return attribute
195
171
@@ -722,47 +698,10 @@ def convert_to_absolute_path(relative_to, file_name):
722
698
return file_name
723
699
724
700
725
- def _get_mbi_attribute_list (path ):
726
- attribute_list = []
727
- for mbean_attribute_info in wlst_helper .get_mbi (path ).getAttributes ():
728
- if _is_attribute (mbean_attribute_info ):
729
- attribute_list .append (mbean_attribute_info .getName ())
730
- return attribute_list
731
-
732
-
733
- def _is_attribute (attributes_info ):
734
- return _is_attribute_type (attributes_info ) or _is_valid_reference (attributes_info )
735
-
736
-
737
- def _is_valid_reference (attribute_info ):
738
- # check again after all done to see whether need to use get deprecated
739
- return _is_reference (attribute_info ) and (
740
- attribute_info .isWritable () or not _is_deprecated (attribute_info ))
741
-
742
-
743
- def _is_reference (mbean_attribute_info ):
744
- return mbean_attribute_info .getDescriptor ().getFieldValue ('com.bea.relationship' ) == 'reference'
745
-
746
-
747
- def _is_deprecated (mbean_attribute_info ):
748
- deprecated_version = mbean_attribute_info .getDescriptor ().getFieldValue ('deprecated' )
749
- return deprecated_version is not None and deprecated_version != 'null' and len (deprecated_version ) > 1
750
-
751
-
752
701
def _is_containment (mbean_attribute_info ):
753
702
return mbean_attribute_info .getDescriptor ().getFieldValue ('com.bea.relationship' ) == 'containment'
754
703
755
704
756
- def _is_attribute_type (attribute_info ):
757
- _method_name = '_is_attribute_type'
758
- if not attribute_info .isWritable () and _is_deprecated (attribute_info ):
759
- _logger .finer ('WLSDPLY-06143' , attribute_info .getName (), wlst_helper .get_pwd (),
760
- class_name = _class_name , method_name = _method_name )
761
- return attribute_info .getDescriptor ().getFieldValue (
762
- 'descriptorType' ) == 'Attribute' and attribute_info .getDescriptor ().getFieldValue (
763
- 'com.bea.relationship' ) is None and (attribute_info .isWritable () or not _is_deprecated (attribute_info ))
764
-
765
-
766
705
def _massage_online_folders (lsc_folders ):
767
706
_method_name = '_massage_online_folders'
768
707
location = wlst_helper .get_pwd ()
0 commit comments