15
15
from wlsdeploy .logging .platform_logger import PlatformLogger
16
16
from wlsdeploy .tool .util .string_output_stream import StringOutputStream
17
17
import wlsdeploy .util .unicode_helper as str_helper
18
+ from wlsdeploy .util .weblogic_helper import WebLogicHelper
18
19
19
20
wlst_functions = None
20
21
@@ -29,6 +30,7 @@ class WlstHelper(object):
29
30
30
31
def __init__ (self , exception_type ):
31
32
self .__exception_type = exception_type
33
+ self .wls_helper = WebLogicHelper (self .__logger )
32
34
33
35
def get_online_server_version_data (self , username , password , url , timeout ):
34
36
"""
@@ -164,19 +166,17 @@ def is_set(self, attribute):
164
166
mbean_path = self .get_pwd ()
165
167
166
168
try :
167
- if self .is_unreliable_is_set ():
168
- # put the value in the model; an att_handler may correct the value
169
- result = True
170
- elif self .__check_online_connection ():
169
+ # if valid isSet method is not available, return True to include the attribute in the model.
170
+ # an att_handler may correct/remove the value after this point.
171
+ result = True
172
+
173
+ if self .__check_online_connection ():
171
174
mbean = self .get_mbean (mbean_path )
172
- # we may call for every attribute for online + local
173
- if 'isSet' not in dir (mbean ):
174
- return True
175
- result = mbean .isSet (attribute )
176
- else :
177
- if not self .__has_global ('isSet' ):
178
- return True
179
- result = self .__load_global ('isSet' )(attribute )
175
+ if 'isSet' in dir (mbean ):
176
+ result = mbean .isSet (attribute )
177
+ elif self .__uses_is_set_with_argument ():
178
+ if self .__has_global ('isSet' ):
179
+ result = self .__load_global ('isSet' )(attribute , isInConfig = 'true' )
180
180
181
181
except (self .__load_global ('WLSTException' ), offlineWLSTException ), e :
182
182
pwe = exception_helper .create_exception (self .__exception_type , 'WLSDPLY-00125' , attribute ,
@@ -192,15 +192,15 @@ def is_set(self, attribute):
192
192
self .__logger .finest ('WLSDPLY-00126' , attribute , class_name = self .__class_name , method_name = _method_name )
193
193
return result
194
194
195
- def is_unreliable_is_set (self ):
195
+ def __uses_is_set_with_argument (self ):
196
196
"""
197
197
Determine if this WLS version's implementation of the WLST isSet() method
198
- is not reliable for deciding to include an attribute value.
199
- Currently, all offline WLS versions that use isSet() (14.1.2+) are not reliable.
200
- Future WLS versions may support a more reliable version of isSet().
201
- :return: True if the implementation of isSet() is unreliable
198
+ uses the isInConfig argument for deciding to include an attribute value in the model.
199
+ Currently, offline WLS version 15.1.1 and above use this argument.
200
+ :return: True if the implementation of isSet() uses the isInConfig argument
202
201
"""
203
- return not self .__check_online_connection ()
202
+ offline = not self .__check_online_connection ()
203
+ return offline and self .wls_helper .uses_offline_is_set_with_argument ()
204
204
205
205
def set_if_needed (self , wlst_name , wlst_value , masked = False ):
206
206
"""
0 commit comments