Skip to content

Commit 75cc0bb

Browse files
authored
Avoid copying variable file to itself (problem on Windows); remove commented code (#912)
1 parent b56cde4 commit 75cc0bb

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2018, 2020, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2018, 2021, Oracle Corporation and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import copy
@@ -253,7 +253,8 @@ def inject_variables_keyword_file(self, append_option=None):
253253
if variable_file_location is not None and os.path.exists(variable_file_location):
254254
# copy the original file first
255255
append = True
256-
shutil.copyfile(variable_file_location, new_variable_file_location)
256+
if variable_file_location != new_variable_file_location:
257+
shutil.copyfile(variable_file_location, new_variable_file_location)
257258
self._filter_duplicate_properties(new_variable_file_location, variable_dictionary)
258259

259260
variable_file_location = new_variable_file_location

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ def process_target_arguments(argument_map):
9191
__logger.throwing(ex, class_name=__class_name, method_name=_method_name)
9292
raise ex
9393

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

10095
def _prepare_k8s_secrets(model_context, token_dictionary, model_dictionary):
10196

0 commit comments

Comments
 (0)