@@ -84,7 +84,7 @@ def _populate_model_parameters(self, dictionary, location):
84
84
else :
85
85
wlst_value = wlst_params [wlst_param ]
86
86
87
- _logger .finest ('WLSDPLY-06105' , wlst_param , wlst_value , wlst_path , class_name = _class_name ,
87
+ _logger .finer ('WLSDPLY-06105' , wlst_param , wlst_value , wlst_path , class_name = _class_name ,
88
88
method_name = _method_name )
89
89
try :
90
90
model_param , model_value = self ._alias_helper .get_model_attribute_name_and_value (location ,
@@ -112,8 +112,14 @@ def _get_attributes_for_current_location(self, location):
112
112
:param location: context with the current location information
113
113
:return: list of attributes
114
114
"""
115
- _method_name = '_get_attributes_for_current_location'
116
- attributes = None
115
+ if self ._wlst_mode == WlstModes .OFFLINE :
116
+ return self ._get_attributes_for_current_location_offline (location )
117
+ else :
118
+ return self ._get_attributes_for_current_location_online (location )
119
+
120
+ def _get_attributes_for_current_location_offline (self , location ):
121
+ _method_name = '_get_attributes_for_current_location_offline'
122
+ attributes = []
117
123
path = self ._alias_helper .get_wlst_attributes_path (location )
118
124
try :
119
125
attributes = wlst_helper .lsa (path )
@@ -123,31 +129,36 @@ def _get_attributes_for_current_location(self, location):
123
129
method_name = _method_name )
124
130
return attributes
125
131
126
- def _get_required_attributes (self , location ):
127
- if self ._wlst_mode == WlstModes .OFFLINE :
128
- return self ._get_required_attributes_offline (location )
129
- else :
130
- return self ._get_required_attributes_online (location )
131
-
132
- def _get_required_attributes_offline (self , location ):
133
- return self ._alias_helper .get_wlst_get_required_attribute_names (location )
132
+ def _get_attributes_for_current_location_online (self , location ):
133
+ _method_name = '_get_attributes_for_current_location_online'
134
+ attributes = []
135
+ path = self ._alias_helper .get_wlst_attributes_path (location )
136
+ try :
137
+ attributes = wlst_helper .lsa (path )
138
+ mbean_attributes = wlst_helper .get_mbi ().getAttributes ()
139
+ for mbean_attribute in mbean_attributes :
140
+ name = mbean_attribute .getName ()
141
+ if name not in attributes :
142
+ attributes [name ] = wlst_helper .get (name )
143
+ except PyWLSTException , pe :
144
+ name = location .get_model_folders ()[- 1 ]
145
+ _logger .fine ('WLSDPLY-06109' , name , str (location ), pe .getLocalizedMessage (), class_name = _class_name ,
146
+ method_name = _method_name )
147
+ return attributes
134
148
135
- def _get_required_attributes_online (self , location ):
149
+ def _get_required_attributes (self , location ):
136
150
"""
137
151
Use get for all online attributes, and use the attribute names in the
138
152
:param location:
139
153
:return:
140
154
"""
141
- _method_name = '_get_required_attributes_online '
155
+ _method_name = '_get_required_attributes '
142
156
attributes = []
143
157
try :
144
- mbi = wlst_helper .get_mbi ()
145
- mbean_attribute_info = mbi .getAttributes ()
146
- for mbean_attribute in mbean_attribute_info :
147
- attributes .append (mbean_attribute .getName ())
148
- except PyWLSTException , pe :
158
+ attributes = self ._alias_helper .get_wlst_get_required_attribute_names (location )
159
+ except DiscoverException , de :
149
160
name = location .get_model_folders ()[- 1 ]
150
- _logger .warning ('WLSDPLY-06109' , name , str (location ), pe .getLocalizedMessage (), class_name = _class_name ,
161
+ _logger .warning ('WLSDPLY-06109' , name , str (location ), de .getLocalizedMessage (), class_name = _class_name ,
151
162
method_name = _method_name )
152
163
return attributes
153
164
@@ -176,7 +187,10 @@ def _check_attribute(self, model_name, model_value, location):
176
187
:param location: context containing current location information
177
188
:return: new value if modified by the handler or the original value if not a special attribute
178
189
"""
179
- new_value = model_value
190
+ if model_value == 'null ' :
191
+ new_value = None
192
+ else :
193
+ new_value = model_value
180
194
if model_name in self ._att_handler_map :
181
195
type_method = self ._att_handler_map [model_name ]
182
196
if type_method is not None :
0 commit comments