Skip to content

Commit 3988c58

Browse files
Add messages before push for pull request
1 parent 8d65d4e commit 3988c58

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

core/src/main/python/wlsdeploy/tool/deploy/deployer_utils.py

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55
from sets import Set
@@ -311,22 +311,41 @@ def get_file_hash(file_name):
311311

312312

313313
def save_changes(model_context):
314-
if _wlst_helper.is_connected():
315-
print '****** online I am'
316-
_wlst_helper.save()
317-
_wlst_helper.activate()
318-
_wlst_helper.disconnect()
314+
"""
315+
Call this if necessary to save changes and disconnect from the domain.
316+
This works in both offline and online.
317+
:param model_context: contains information about the current tool settings
318+
"""
319+
_method_name = 'save_changes'
320+
if model_context.get_target_wlst_mode() == WlstModes.ONLINE:
321+
if _wlst_helper.is_connected():
322+
_logger.fine('WLSDPLY-09110', class_name=_class_name, method_name=_method_name)
323+
_wlst_helper.save()
324+
_wlst_helper.activate()
325+
_wlst_helper.disconnect()
326+
else:
327+
_logger.fine('WLSDPLY-09109', class_name=_class_name, method_name=_method_name)
319328
else:
320-
print '******* offline I am'
329+
_logger.fine('WLSDPLY-09111', class_name=_class_name, method_name=_method_name)
321330
_wlst_helper.update_domain()
322331

323332

324333
def read_again(model_context):
325-
if _wlst_helper.is_connected():
326-
_wlst_helper.connect( model_context.get_admin_user(), model_context.get_admin_password(),
327-
model_context.get_admin_url())
328-
_wlst_helper.edit()
329-
_wlst_helper.start_edit()
334+
"""
335+
Establish connection with the domain and start editing in both online and offline wlst mode.
336+
:param model_context: contains information about the current tool settings
337+
"""
338+
_method_name = 'read_again'
339+
if model_context.get_target_wlst_mode() == WlstModes.ONLINE:
340+
if not _wlst_helper.is_connected():
341+
_logger.fine('WLSDPLY-09113', class_name=_class_name, method_name=_method_name)
342+
_wlst_helper.connect(model_context.get_admin_user(), model_context.get_admin_password(),
343+
model_context.get_admin_url())
344+
_wlst_helper.edit()
345+
_wlst_helper.start_edit()
346+
else:
347+
_logger.fine('WLSDPLY-09112', class_name=_class_name, method_name=_method_name)
330348
else:
349+
_logger.fine('WLSDPLY-09114', class_name=_class_name, method_name=_method_name)
331350
_wlst_helper.close_domain()
332351
_wlst_helper.read_domain(model_context.get_domain_home())

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,13 @@ WLSDPLY-09106=Shared library name {0} contained {1} @ signs when only zero or on
830830
WLSDPLY-09107=Shared library name {0} contained {1} # signs when only zero or one are allowed
831831
WLSDPLY-09108=Model attribute {0} at model location {1} with value {2} references a location inside \
832832
the archive file but the archive file was not provided
833+
WLSDPLY-09109=Deploy is running in online mode, but is not connected. Bypass the update and disconnect.
834+
WLSDPLY-09110=Saving and activating updates to the domain in online mode and disconnecting wlst from the admin server.
835+
WLSDPLY-09111=Saving updates to domain in offline mode and closing the domain.
836+
WLSDPLY-09112=Connection with admin server already established for the domain. Bypass the connect and start edit session
837+
WLSDPLY-09113=Re-establish online connection with wlst to refresh with the current domain configuration and start edit \
838+
session to continue the updates.
839+
WLSDPLY-09114=Re-read domain in offline wlst to refresh the current domain configuration and continue the updates.
833840

834841
# wlsdeploy/tool/deploy/deployer.py
835842
WLSDPLY-09200=Error setting attribute {0} for {1} {2}: {3}

0 commit comments

Comments
 (0)