Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/python/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def main(args):
aliases = Aliases(model_context, wlst_mode=__wlst_mode, exception_type=ExceptionType.DISCOVER)
model = None
credential_injector = None
if model_context.get_variable_file() is not None:
if model_context.get_variable_file() is not None or model_context.get_target() is not None:
credential_injector = CredentialInjector(_program_name, dict(), model_context,
WebLogicHelper(__logger).get_actual_weblogic_version())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ def process_target_arguments(argument_map):
__logger.throwing(ex, class_name=__class_name, method_name=_method_name)
raise ex

# Set the -variable_file parameter if not present with default
# if CommandLineArgUtil.VARIABLE_FILE_SWITCH not in argument_map:
# path = os.path.join(output_dir, target_name + "_variable.properties")
# argument_map[CommandLineArgUtil.VARIABLE_FILE_SWITCH] = path


def _prepare_k8s_secrets(model_context, token_dictionary, model_dictionary):

Expand Down
20 changes: 14 additions & 6 deletions core/src/main/python/wlsdeploy/util/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,22 @@ def get_default_variable_file_name(model_context):
:return: location and file name of variable properties file.
"""
_method_name = 'get_default_variable_file_name'
extract_file_name = model_context.get_model_file()
if not extract_file_name:
extract_file_name = model_context.get_archive_file_name()
default_variable_file = path_utils.get_filename_no_ext_from_path(extract_file_name)

if model_context.get_target() is not None:
default_variable_file = os.path.join(model_context.get_output_dir(), model_context.get_target() +
"_variable.properties")
else:
extract_file_name = model_context.get_model_file()
if not extract_file_name:
extract_file_name = model_context.get_archive_file_name()
default_variable_file = path_utils.get_filename_no_ext_from_path(extract_file_name)

if default_variable_file:
default_variable_file = os.path.join(path_utils.get_pathname_from_path(extract_file_name),
default_variable_file + '.properties')
if default_variable_file:
default_variable_file = os.path.join(path_utils.get_pathname_from_path(extract_file_name),
default_variable_file + '.properties')
_logger.finer('WLSDPLY-01736', default_variable_file, class_name=_class_name, method_name=_method_name)

return default_variable_file


Expand Down