Skip to content

Commit 6ec0bd1

Browse files
committed
Merge branch 'wdt-797' into 'main'
Force online discover to force disconnect to avoid hanging See merge request weblogic-cloud/weblogic-deploy-tooling!1554
2 parents a180119 + f14c0d0 commit 6ec0bd1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

core/src/main/python/discover.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ def __disconnect_domain(helper):
440440

441441
if __wlst_mode == WlstModes.ONLINE:
442442
try:
443-
helper.disconnect()
443+
# Force disconnect in case the domain is in dev mode and the user
444+
# has opened the Console, which automatically acquires an edit lock.
445+
helper.disconnect('true')
444446
except PyWLSTException, wlst_ex:
445447
ex = exception_helper.create_discover_exception('WLSDPLY-06006',
446448
wlst_ex.getLocalizedMessage(), error=wlst_ex)

core/src/main/python/wlsdeploy/tool/util/wlst_helper.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -829,16 +829,17 @@ def connect(self, username, password, url, timeout):
829829

830830
self.__logger.exiting(class_name=self.__class_name, method_name=_method_name)
831831

832-
def disconnect(self):
832+
def disconnect(self, force='false'):
833833
"""
834834
Disconnects WLST from the current connected WebLogic Server instance.
835+
:param: whether to force disconnect (value must be a string)
835836
:raises: Exception for the specified tool type: if a WLST error occurs
836837
"""
837838
_method_name = 'disconnect'
838-
self.__logger.entering(class_name=self.__class_name, method_name=_method_name)
839+
self.__logger.entering(force, class_name=self.__class_name, method_name=_method_name)
839840

840841
try:
841-
self.__load_global('disconnect')()
842+
self.__load_global('disconnect')(force)
842843
except self.__load_global('WLSTException'), e:
843844
pwe = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-00048',
844845
_format_exception(e), error=e)

0 commit comments

Comments
 (0)