Skip to content

Commit 403ae8c

Browse files
committed
Created a deep copy of model_dict to ensure it's treated as a "read-only'" reference variable, during the entire validation process
1 parent 9fa1f5f commit 403ae8c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/src/main/python/wlsdeploy/tool/validate/validator.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55
import os
6+
import copy
67

78
from oracle.weblogic.deploy.util import WLSDeployArchive
89
from oracle.weblogic.deploy.util import VariableException
@@ -108,9 +109,11 @@ def validate_in_standalone_mode(self, model_dict, variables_file_name=None, arch
108109
"""
109110
_method_name = 'validate_in_standalone_mode'
110111

112+
cloned_model_dict = copy.deepcopy(model_dict)
113+
111114
self._logger.entering(variables_file_name, archive_file_name, class_name=_class_name, method_name=_method_name)
112115
self._validation_mode = _ValidationModes.STANDALONE
113-
self.__validate_model_file(model_dict, variables_file_name, archive_file_name)
116+
self.__validate_model_file(cloned_model_dict, variables_file_name, archive_file_name)
114117

115118
self._logger.exiting(class_name=_class_name, method_name=_method_name)
116119
return self._validation_results
@@ -137,10 +140,12 @@ def validate_in_tool_mode(self, model_dict, variables_file_name=None, archive_fi
137140
"""
138141
_method_name = 'validate_in_tool_mode'
139142

143+
cloned_model_dict = copy.deepcopy(model_dict)
144+
140145
self._logger.entering(variables_file_name, archive_file_name, class_name=_class_name, method_name=_method_name)
141146
return_code = Validator.ReturnCode.STOP
142147
self._validation_mode = _ValidationModes.TOOL
143-
self.__validate_model_file(model_dict, variables_file_name, archive_file_name)
148+
self.__validate_model_file(cloned_model_dict, variables_file_name, archive_file_name)
144149

145150
status = Validator.ValidationStatus.VALID
146151

0 commit comments

Comments
 (0)