1515from wlsdeploy .logging .platform_logger import PlatformLogger
1616from wlsdeploy .tool .util .string_output_stream import StringOutputStream
1717import wlsdeploy .util .unicode_helper as str_helper
18+ from wlsdeploy .util .weblogic_helper import WebLogicHelper
1819
1920wlst_functions = None
2021
@@ -29,6 +30,7 @@ class WlstHelper(object):
2930
3031 def __init__ (self , exception_type ):
3132 self .__exception_type = exception_type
33+ self .wls_helper = WebLogicHelper (self .__logger )
3234
3335 def get_online_server_version_data (self , username , password , url , timeout ):
3436 """
@@ -164,19 +166,17 @@ def is_set(self, attribute):
164166 mbean_path = self .get_pwd ()
165167
166168 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 ():
171174 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' )
180180
181181 except (self .__load_global ('WLSTException' ), offlineWLSTException ), e :
182182 pwe = exception_helper .create_exception (self .__exception_type , 'WLSDPLY-00125' , attribute ,
@@ -192,15 +192,15 @@ def is_set(self, attribute):
192192 self .__logger .finest ('WLSDPLY-00126' , attribute , class_name = self .__class_name , method_name = _method_name )
193193 return result
194194
195- def is_unreliable_is_set (self ):
195+ def __uses_is_set_with_argument (self ):
196196 """
197197 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
202201 """
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 ()
204204
205205 def set_if_needed (self , wlst_name , wlst_value , masked = False ):
206206 """
0 commit comments