Skip to content

Commit f1ea9f8

Browse files
authored
Add restart changes (#815)
* rename rollback file * rename rollback_changes... to cancel_chanages...
1 parent 22e6519 commit f1ea9f8

File tree

15 files changed

+49
-47
lines changed

15 files changed

+49
-47
lines changed

core/src/main/python/deploy.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
CommandLineArgUtil.PASSPHRASE_SWITCH,
6565
CommandLineArgUtil.OUTPUT_DIR_SWITCH,
6666
CommandLineArgUtil.DISCARD_CURRENT_EDIT_SWITCH,
67-
CommandLineArgUtil.ROLLBACK_IF_RESTART_REQ_SWITCH
67+
CommandLineArgUtil.CANCEL_CHANGES_IF_RESTART_REQ_SWITCH
6868
]
6969

7070

@@ -152,15 +152,16 @@ def __deploy_online(model, model_context, aliases):
152152
restart_required = __wlst_helper.is_restart_required()
153153
is_restartreq_output = sostream.get_string()
154154
__wlst_helper.silence()
155-
if model_context.is_rollback_if_restart_required() and restart_required:
155+
if model_context.is_cancel_changes_if_restart_required() and restart_required:
156156
__wlst_helper.cancel_edit()
157157
__logger.warning('WLSDPLY_09015', is_restartreq_output)
158-
exit_code = CommandLineArgUtil.PROG_ROLLBACK_IF_RESTART_EXIT_CODE
159-
deployer_utils.list_rollback_changes(model_context, is_restartreq_output)
158+
exit_code = CommandLineArgUtil.PROG_CANCEL_CHANGES_IF_RESTART_EXIT_CODE
159+
deployer_utils.list_non_dynamic_changes(model_context, is_restartreq_output)
160160
else:
161161
__wlst_helper.save()
162162
__wlst_helper.activate(model_context.get_model_config().get_activate_timeout())
163163
if restart_required:
164+
deployer_utils.list_non_dynamic_changes(model_context, is_restartreq_output)
164165
exit_code = CommandLineArgUtil.PROG_RESTART_REQUIRED
165166
exit_code = deployer_utils.list_restarts(model_context, exit_code)
166167
except BundleAwareException, ex:

core/src/main/python/update.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
CommandLineArgUtil.ADMIN_PASS_SWITCH,
6565
CommandLineArgUtil.USE_ENCRYPTION_SWITCH,
6666
CommandLineArgUtil.PASSPHRASE_SWITCH,
67-
CommandLineArgUtil.ROLLBACK_IF_RESTART_REQ_SWITCH,
67+
CommandLineArgUtil.CANCEL_CHANGES_IF_RESTART_REQ_SWITCH,
6868
CommandLineArgUtil.OUTPUT_DIR_SWITCH,
6969
CommandLineArgUtil.UPDATE_RCU_SCHEMA_PASS_SWITCH,
7070
CommandLineArgUtil.DISCARD_CURRENT_EDIT_SWITCH
@@ -168,9 +168,9 @@ def __update_online(model, model_context, aliases):
168168
raise de
169169

170170
exit_code = __check_update_require_domain_restart(model_context)
171-
# if user requested rollback if restart required stops
171+
# if user requested cancel changes if restart required stops
172172

173-
if exit_code != CommandLineArgUtil.PROG_ROLLBACK_IF_RESTART_EXIT_CODE:
173+
if exit_code != CommandLineArgUtil.PROG_CANCEL_CHANGES_IF_RESTART_EXIT_CODE:
174174
model_deployer.deploy_applications(model, model_context, aliases, wlst_mode=__wlst_mode)
175175

176176
try:
@@ -197,16 +197,17 @@ def __check_update_require_domain_restart(model_context):
197197
restart_required = __wlst_helper.is_restart_required()
198198
is_restartreq_output = sostream.get_string()
199199
__wlst_helper.silence()
200-
if model_context.is_rollback_if_restart_required() and restart_required:
200+
if model_context.is_cancel_changes_if_restart_required() and restart_required:
201201
__wlst_helper.cancel_edit()
202202
__logger.warning('WLSDPLY_09015', is_restartreq_output)
203-
exit_code = CommandLineArgUtil.PROG_ROLLBACK_IF_RESTART_EXIT_CODE
204-
deployer_utils.list_rollback_changes(model_context, is_restartreq_output)
203+
exit_code = CommandLineArgUtil.PROG_CANCEL_CHANGES_IF_RESTART_EXIT_CODE
204+
deployer_utils.list_non_dynamic_changes(model_context, is_restartreq_output)
205205
else:
206206
__wlst_helper.save()
207207
__wlst_helper.activate(model_context.get_model_config().get_activate_timeout())
208208
if restart_required:
209209
exit_code = CommandLineArgUtil.PROG_RESTART_REQUIRED
210+
deployer_utils.list_non_dynamic_changes(model_context, is_restartreq_output)
210211
exit_code = deployer_utils.list_restarts(model_context, exit_code)
211212

212213
except BundleAwareException, ex:

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -494,19 +494,19 @@ def list_restarts(model_context, exit_code):
494494
return result
495495

496496

497-
def list_rollback_changes(model_context, rollback_string):
497+
def list_non_dynamic_changes(model_context, non_dynamic_changes_string):
498498
"""
499-
If output dir is present in the model context, write the restart data to the output dir as rollback.file.
499+
If output dir is present in the model context, write the restart data to the output dir as non_dynamic_changes.file.
500500
:param model_context: Current context with the run parameters.
501-
:param rollback_string: java.lang.String of changes that were rolled back
501+
:param non_dynamic_changes_string: java.lang.String of changes that were non dynamic
502502
"""
503-
_method_name = 'list_rollback_changes'
503+
_method_name = 'list_non_dynamic_changes'
504504
_logger.entering(class_name=_class_name, method_name=_method_name)
505505
output_dir = model_context.get_output_dir()
506-
if len(str(rollback_string)) > 0 and output_dir is not None:
507-
file_name = os.path.join(output_dir, 'rollback.file')
506+
if len(str(non_dynamic_changes_string)) > 0 and output_dir is not None:
507+
file_name = os.path.join(output_dir, 'non_dynamic_changes.file')
508508
pw = FileUtils.getPrintWriter(file_name)
509-
pw.println(rollback_string)
509+
pw.println(non_dynamic_changes_string)
510510
pw.close()
511511

512512

core/src/main/python/wlsdeploy/util/cla_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CommandLineArgUtil(object):
6464
ENCRYPT_MANUAL_SWITCH = '-manual'
6565
# phony arg used as a key to store the password
6666
ONE_PASS_SWITCH = '-password'
67-
ROLLBACK_IF_RESTART_REQ_SWITCH = '-rollback_if_restart_required'
67+
CANCEL_CHANGES_IF_RESTART_REQ_SWITCH = '-cancel_changes_if_restart_required'
6868
USE_ENCRYPTION_SWITCH = '-use_encryption'
6969
RUN_RCU_SWITCH = '-run_rcu'
7070
TARGET_VERSION_SWITCH = '-target_version'
@@ -96,7 +96,7 @@ class CommandLineArgUtil(object):
9696
FOLDERS_ONLY_SWITCH,
9797
MODEL_SAMPLE_SWITCH,
9898
RECURSIVE_SWITCH,
99-
ROLLBACK_IF_RESTART_REQ_SWITCH,
99+
CANCEL_CHANGES_IF_RESTART_REQ_SWITCH,
100100
RUN_RCU_SWITCH,
101101
UPDATE_RCU_SCHEMA_PASS_SWITCH,
102102
DISCARD_CURRENT_EDIT_SWITCH,
@@ -119,7 +119,7 @@ class CommandLineArgUtil(object):
119119
USAGE_ERROR_EXIT_CODE = 99
120120
ARG_VALIDATION_ERROR_EXIT_CODE = 98
121121
PROG_RESTART_REQUIRED = 103
122-
PROG_ROLLBACK_IF_RESTART_EXIT_CODE = 104
122+
PROG_CANCEL_CHANGES_IF_RESTART_EXIT_CODE = 104
123123
PROG_ERROR_EXIT_CODE = 2
124124
PROG_WARNING_EXIT_CODE = 1
125125
PROG_OK_EXIT_CODE = 0

core/src/main/python/wlsdeploy/util/model_context.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __init__(self, program_name, arg_map):
8181
self._opss_wallet = None
8282
self._update_rcu_schema_pass = False
8383
self._validation_method = None
84-
self._rollback_if_restart_required = None
84+
self._cancel_changes_if_restart_required = None
8585
self._domain_resource_file = None
8686
self._output_dir = None
8787
self._target = None
@@ -187,8 +187,8 @@ def __copy_from_args(self, arg_map):
187187
if CommandLineArgUtil.ONE_PASS_SWITCH in arg_map:
188188
self._encrypt_one_pass = arg_map[CommandLineArgUtil.ONE_PASS_SWITCH]
189189

190-
if CommandLineArgUtil.ROLLBACK_IF_RESTART_REQ_SWITCH in arg_map:
191-
self._rollback_if_restart_required = arg_map[CommandLineArgUtil.ROLLBACK_IF_RESTART_REQ_SWITCH]
190+
if CommandLineArgUtil.CANCEL_CHANGES_IF_RESTART_REQ_SWITCH in arg_map:
191+
self._cancel_changes_if_restart_required = arg_map[CommandLineArgUtil.CANCEL_CHANGES_IF_RESTART_REQ_SWITCH]
192192

193193
if CommandLineArgUtil.USE_ENCRYPTION_SWITCH in arg_map:
194194
self._use_encryption = arg_map[CommandLineArgUtil.USE_ENCRYPTION_SWITCH]
@@ -296,8 +296,8 @@ def __copy__(self):
296296
arg_map[CommandLineArgUtil.ENCRYPT_MANUAL_SWITCH] = self._encrypt_manual
297297
if self._encrypt_one_pass is not None:
298298
arg_map[CommandLineArgUtil.ONE_PASS_SWITCH] = self._encrypt_one_pass
299-
if self._rollback_if_restart_required is not None:
300-
arg_map[CommandLineArgUtil.ROLLBACK_IF_RESTART_REQ_SWITCH] = self._rollback_if_restart_required
299+
if self._cancel_changes_if_restart_required is not None:
300+
arg_map[CommandLineArgUtil.CANCEL_CHANGES_IF_RESTART_REQ_SWITCH] = self._cancel_changes_if_restart_required
301301
if self._use_encryption is not None:
302302
arg_map[CommandLineArgUtil.USE_ENCRYPTION_SWITCH] = self._use_encryption
303303
if self._archive_file is not None:
@@ -452,12 +452,12 @@ def get_archive_file_name(self):
452452
"""
453453
return self._archive_file_name
454454

455-
def is_rollback_if_restart_required(self):
455+
def is_cancel_changes_if_restart_required(self):
456456
"""
457-
Get the rollback if restart required
457+
Get the cancel changes if restart required
458458
:return: true or false
459459
"""
460-
return self._rollback_if_restart_required
460+
return self._cancel_changes_if_restart_required
461461

462462
def is_discard_current_edit(self):
463463
"""

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ WLSDPLY-09012=While handling an error, failed to stop the current edit session a
10131013
WLSDPLY-09013=While handling an error, failed to close the domain: {0}
10141014
WLSDPLY-09014={0} was unable to load the model from {1} due to a translation error: {2}
10151015
WLSDPLY-09015={0} deployment failed: {1}
1016-
WLSDPLY_09015=Online update has been rollback because the flag rollback_if_restart_required is set and the update requires \
1016+
WLSDPLY_09015=Online update has been canceled because the flag cancel_changes_if_restart_required is set and the update requires \
10171017
restart: {0}
10181018
WLSDPLY-09016=There are outstanding changes but -discard_current_edit has been specified, all changes have been \
10191019
discarded before processing update.

installer/src/main/bin/deployApps.cmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ECHO [-model_file ^<model_file^>]
7777
ECHO [-variable_file ^<variable_file^>]
7878
ECHO [-domain_type ^<domain_type^>]
7979
ECHO [-wlst_path ^<wlst_path^>]
80-
ECHO [-rollback_if_restart_required]
80+
ECHO [-canel_changes_if_restart_required]
8181
ECHO [-discard_current_edit]
8282
ECHO [-output_dir]
8383
ECHO [-admin_url ^<admin_url^>
@@ -115,12 +115,12 @@ ECHO admin_url - the admin server URL (used for online deploy)
115115
ECHO.
116116
ECHO admin_user - the admin username (used for online deploy)
117117
ECHO.
118-
ECHO rollback_if_restart_required - rollback the changes if the update requires domain restart
118+
ECHO cancel_changes_if_restart_required - cancel the changes if the update requires domain restart
119119
ECHO.
120120
ECHO discard_current_edit - discard all existing changes before starting update
121121
ECHO.
122122
ECHO output_dir - if present, write restart information to this directory as restart.file, or,
123-
ECHO if rollback_if_restart_required used, write rollback information to rollback.file
123+
ECHO if cancel_changes_if_restart_required used, write non dynamic changes information to non_dynamic_changes.file
124124
ECHO.
125125
ECHO The -use_encryption switch tells the program that one or more of the
126126
ECHO passwords in the model or variables files are encrypted. The program will

installer/src/main/bin/deployApps.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ usage() {
3838
echo " [-variable_file <variable_file>]"
3939
echo " [-domain_type <domain_type>]"
4040
echo " [-wlst_path <wlst_path>]"
41-
echo " [-rollback_if_restart_required]"
41+
echo " [-cancel_changes_if_restart_required]"
4242
echo " [-discard_current_edit]"
4343
echo " [-output_dir]"
4444
echo " [-admin_url <admin_url>"
@@ -76,12 +76,12 @@ usage() {
7676
echo ""
7777
echo " admin_user - the admin username (used for online deploy)"
7878
echo ""
79-
echo " rollback_if_restart_required - rollback the changes if the update requires domain restart"
79+
echo " cancel_changes_if_restart_required - cancel the changes if the update requires domain restart"
8080
echo ""
8181
echo " discard_current_edit - discard all existing changes before starting update"
8282
echo ""
8383
echo " output_dir - if present, write restart information to this directory in restart.file, or,"
84-
echo " if rollback_if_restart_required used, write rollback information to rollback.file"
84+
echo " if canel_changes_if_restart_required used, write non dynamic changes information to non_dynamic_changes.file"
8585
echo ""
8686
echo " The -use_encryption switch tells the program that one or more of the"
8787
echo " passwords in the model or variables files are encrypted. The program will"

installer/src/main/bin/shared.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ GOTO :EOF
351351

352352
IF "%RETURN_CODE%" == "104" (
353353
ECHO.
354-
ECHO %SCRIPT_NAME% completed successfully but the domain changes have been rolled back because -rollback_if_restart_required is specified ^(exit code = %RETURN_CODE%^)
354+
ECHO %SCRIPT_NAME% completed successfully but the domain changes have been canceled because -cancel_changes_if_restart_required is specified ^(exit code = %RETURN_CODE%^)
355355
EXIT /B %RETURN_CODE%
356356
)
357357
IF "%RETURN_CODE%" == "103" (

installer/src/main/bin/shared.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ checkExitCode() {
305305

306306
if [ $returnCode -eq 104 ]; then
307307
echo ""
308-
echo "$scriptName completed successfully but the domain changes have been rolled back because -rollback_if_restart_required is specified (exit code = ${RETURN_CODE})"
308+
echo "$scriptName completed successfully but the domain changes have been canceled because -cancel_changes_if_restart_required is specified (exit code = ${RETURN_CODE})"
309309
elif [ $returnCode -eq 103 ]; then
310310
echo ""
311311
echo "$scriptName completed successfully but the domain requires a restart for the changes to take effect (exit code = ${RETURN_CODE})"

0 commit comments

Comments
 (0)