Skip to content

Commit 05591f2

Browse files
committed
adding logic to discoverDomain to validate -skip_archive and -remote args
1 parent fcd55b0 commit 05591f2

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

core/src/main/python/discover.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
44
55
The entry point for the discoverDomain tool.
@@ -140,6 +140,8 @@ def __process_args(args, is_encryption_supported):
140140
if __wlst_mode == WlstModes.ONLINE:
141141
cla_helper.process_encryption_args(argument_map, is_encryption_supported)
142142

143+
__validate_skip_archive_and_remote_args(argument_map, __wlst_mode)
144+
143145
target_configuration_helper.process_target_arguments(argument_map)
144146
__process_model_arg(argument_map)
145147
__process_archive_filename_arg(argument_map)
@@ -154,6 +156,23 @@ def __process_args(args, is_encryption_supported):
154156
return model_context
155157

156158

159+
def __validate_skip_archive_and_remote_args(argument_map, wlst_mode):
160+
_method_name = '__validate_skip_archive_and_remote_args'
161+
162+
if wlst_mode == WlstModes.OFFLINE and CommandLineArgUtil.REMOTE_SWITCH in argument_map:
163+
ex = exception_helper.create_cla_exception(ExitCode.ARG_VALIDATION_ERROR, 'WLSDPLY-06064',
164+
_program_name, CommandLineArgUtil.REMOTE_SWITCH)
165+
__logger.throwing(ex, class_name=_class_name, method_name=_method_name)
166+
raise ex
167+
168+
if CommandLineArgUtil.REMOTE_SWITCH in argument_map and CommandLineArgUtil.SKIP_ARCHIVE_FILE_SWITCH in argument_map:
169+
ex = exception_helper.create_cla_exception(ExitCode.ARG_VALIDATION_ERROR, 'WLSDPLY-06065',
170+
_program_name, CommandLineArgUtil.REMOTE_SWITCH,
171+
CommandLineArgUtil.SKIP_ARCHIVE_FILE_SWITCH)
172+
__logger.throwing(ex, class_name=_class_name, method_name=_method_name)
173+
raise ex
174+
175+
157176
def __process_model_arg(argument_map):
158177
"""
159178
Verify that specified model file's parent directory exists.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,8 @@ WLSDPLY-06060={0} invoked with {1} argument but discovering security provider da
819819
WLSDPLY-06061=Enter the OPSS wallet passphrase to use to encrypt the OPSS wallet
820820
WLSDPLY-06062=Failed to read OPSS wallet passphrase: {0}
821821
WLSDPLY-06063=User failed to provide the required OPSS wallet passphrase
822+
WLSDPLY-06064={0} invoked with {1} argument but that argument is only valid in online mode.
823+
WLSDPLY-06065={0} invoked with both {1} and {2} arguments, which are mutually exclusive.
822824

823825
# discoverer.py
824826
WLSDPLY-06100=Find attributes at location {0}

0 commit comments

Comments
 (0)