Skip to content

Commit b4731b6

Browse files
removing deprecated -domain_resource_file argument (#1341)
* removing deprecated -domain_resource_file argument * removing more references to -domain_resource_file arg
1 parent 5c12f57 commit b4731b6

File tree

5 files changed

+5
-76
lines changed

5 files changed

+5
-76
lines changed

core/src/main/python/extract_resource.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535

3636
__required_arguments = [
3737
CommandLineArgUtil.MODEL_FILE_SWITCH,
38-
CommandLineArgUtil.ORACLE_HOME_SWITCH
38+
CommandLineArgUtil.ORACLE_HOME_SWITCH,
39+
CommandLineArgUtil.OUTPUT_DIR_SWITCH
3940
]
4041

4142
__optional_arguments = [
@@ -49,8 +50,6 @@
4950
CommandLineArgUtil.PASSPHRASE_SWITCH,
5051
CommandLineArgUtil.PASSPHRASE_FILE_SWITCH,
5152
CommandLineArgUtil.PASSPHRASE_ENV_SWITCH,
52-
CommandLineArgUtil.OUTPUT_DIR_SWITCH, # move to __required_arguments once DOMAIN_RESOURCE_FILE_SWITCH is removed
53-
CommandLineArgUtil.DOMAIN_RESOURCE_FILE_SWITCH # deprecated, only this program uses it
5453
]
5554

5655

@@ -80,18 +79,6 @@ def __process_args(args):
8079
# allow unresolved tokens and archive entries
8180
argument_map[CommandLineArgUtil.VALIDATION_METHOD] = validate_configuration.LAX_METHOD
8281

83-
# warn about deprecated -domain_resource_file argument.
84-
# not needed once -domain_resource_file is removed and -output_dir moves to __required_arguments.
85-
if CommandLineArgUtil.DOMAIN_RESOURCE_FILE_SWITCH in argument_map:
86-
__logger.warning('WLSDPLY-10040', CommandLineArgUtil.DOMAIN_RESOURCE_FILE_SWITCH,
87-
CommandLineArgUtil.OUTPUT_DIR_SWITCH, class_name=_class_name, method_name=_method_name)
88-
elif CommandLineArgUtil.OUTPUT_DIR_SWITCH not in argument_map:
89-
ex = exception_helper.create_cla_exception(ExitCode.USAGE_ERROR, 'WLSDPLY-20005',
90-
_program_name, CommandLineArgUtil.OUTPUT_DIR_SWITCH,
91-
class_name=_class_name, method_name=_method_name)
92-
__logger.throwing(ex, class_name=_class_name, method_name=_method_name)
93-
raise ex
94-
9582
return model_context_helper.create_context(_program_name, argument_map)
9683

9784

core/src/main/python/wlsdeploy/tool/util/targets/additional_output_helper.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,38 +90,14 @@ def create_additional_output(model, model_context, aliases, credential_injector,
9090
template_hash = _build_template_hash(model, model_context, aliases, credential_injector, domain_home_override)
9191
for index, template_name in enumerate(template_names):
9292
source_file_name = _get_template_source_name(template_name, target_configuration)
93-
94-
# special processing for deprecated -domain_resource_file argument of extractDomainResource
95-
extract_output_file = _get_extract_output_file(template_name, index, model_context)
96-
if extract_output_file:
97-
output_file = extract_output_file
98-
else:
99-
output_file = File(os.path.join(output_dir, template_name))
93+
output_file = File(os.path.join(output_dir, template_name))
10094

10195
_create_file(source_file_name, template_hash, output_file, exception_type)
10296

10397
crd_helper = model_crd_helper.get_helper(model_context)
10498
crd_file_updater.update_from_model(output_file, model, crd_helper)
10599

106100

107-
# *** DELETE METHOD WHEN deprecated -domain_resource_file IS REMOVED ***
108-
def _get_extract_output_file(template_name, index, model_context):
109-
"""
110-
Special processing for deprecated -domain_resource_file argument used by extractDomainResource.
111-
Use the directory of -domain_resource_file for all templates,
112-
and the name of -domain_resource_file for the first (usually only) template.
113-
"""
114-
_method_name = '_get_extract_output_file'
115-
116-
resource_file = model_context.get_domain_resource_file()
117-
if resource_file:
118-
output_dir, output_name = os.path.split(resource_file)
119-
if index > 0:
120-
output_name = template_name
121-
return File(os.path.join(output_dir, output_name))
122-
return None
123-
124-
125101
def _create_file(template_name, template_hash, output_file, exception_type):
126102
"""
127103
Read the template from the resource stream, perform any substitutions,

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ class CommandLineArgUtil(object):
9595
VARIABLE_INJECTOR_FILE_SWITCH = '-variable_injector_file'
9696
VARIABLE_KEYWORDS_FILE_SWITCH = '-variable_keywords_file'
9797
VARIABLE_PROPERTIES_FILE_SWITCH = '-variable_properties_file'
98-
# extractDomainResource output file
99-
DOMAIN_RESOURCE_FILE_SWITCH = '-domain_resource_file'
10098
OUTPUT_DIR_SWITCH = "-output_dir"
10199
WAIT_FOR_EDIT_LOCK_SWITCH = "-wait_for_edit_lock"
102100
TARGET_SWITCH = '-target'
@@ -324,10 +322,6 @@ def process_args(self, args, tool_type=TOOL_TYPE_DEFAULT, trailing_arg_count=0):
324322
value, idx = self._get_arg_value(args, idx)
325323
full_path = self._validate_variable_properties_file_arg(value)
326324
self._add_arg(key, full_path, True)
327-
elif self.is_domain_resource_file_key(key):
328-
value, idx = self._get_arg_value(args, idx)
329-
full_path = self._validate_domain_resource_file_arg(value)
330-
self._add_arg(key, full_path, True)
331325
elif self.is_boolean_switch(key):
332326
self._add_arg(key, True)
333327
elif self.is_compare_model_output_dir_switch(key):
@@ -1022,21 +1016,6 @@ def _validate_variable_properties_file_arg(self, value):
10221016
raise ex
10231017
return variables.getAbsolutePath()
10241018

1025-
def is_domain_resource_file_key(self, key):
1026-
return self.DOMAIN_RESOURCE_FILE_SWITCH == key
1027-
1028-
def _validate_domain_resource_file_arg(self, value):
1029-
method_name = '_validate_domain_resource_file_arg'
1030-
1031-
try:
1032-
variables = JFileUtils.validateFileName(value)
1033-
except JIllegalArgumentException, iae:
1034-
ex = create_cla_exception(ExitCode.ARG_VALIDATION_ERROR,
1035-
'WLSDPLY-01637', value, iae.getLocalizedMessage(), error=iae)
1036-
_logger.throwing(ex, class_name=self._class_name, method_name=method_name)
1037-
raise ex
1038-
return variables.getAbsolutePath()
1039-
10401019
def is_boolean_switch(self, key):
10411020
return key in self.BOOLEAN_SWITCHES
10421021

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def __init__(self, program_name, arg_map):
9191
self._validation_method = None
9292
self._validate_configuration = None # lazy load
9393
self._cancel_changes_if_restart_required = None
94-
self._domain_resource_file = None
9594
self._output_dir = None
9695
self._target = None
9796
self._target_configuration = None # lazy load
@@ -236,9 +235,6 @@ def __copy_from_args(self, arg_map):
236235
if CommandLineArgUtil.TARGET_VERSION_SWITCH in arg_map:
237236
self._wl_version = arg_map[CommandLineArgUtil.TARGET_VERSION_SWITCH]
238237

239-
if CommandLineArgUtil.DOMAIN_RESOURCE_FILE_SWITCH in arg_map:
240-
self._domain_resource_file = arg_map[CommandLineArgUtil.DOMAIN_RESOURCE_FILE_SWITCH]
241-
242238
if CommandLineArgUtil.TRAILING_ARGS_SWITCH in arg_map:
243239
self._trailing_args = arg_map[CommandLineArgUtil.TRAILING_ARGS_SWITCH]
244240

@@ -343,8 +339,6 @@ def __copy__(self):
343339
arg_map[CommandLineArgUtil.VALIDATION_METHOD] = self._validation_method
344340
if self._wl_version is not None:
345341
arg_map[CommandLineArgUtil.TARGET_VERSION_SWITCH] = self._wl_version
346-
if self._domain_resource_file is not None:
347-
arg_map[CommandLineArgUtil.DOMAIN_RESOURCE_FILE_SWITCH] = self._domain_resource_file
348342
if self._trailing_args is not None:
349343
arg_map[CommandLineArgUtil.TRAILING_ARGS_SWITCH] = self._trailing_args
350344
if self._target is not None:
@@ -442,13 +436,6 @@ def get_domain_typedef(self):
442436
"""
443437
return self._domain_typedef
444438

445-
def get_domain_resource_file(self):
446-
"""
447-
Get the domain resource file.
448-
:return: the domain resource file
449-
"""
450-
return self._domain_resource_file
451-
452439
def get_admin_url(self):
453440
"""
454441
Get the admin URL.

core/src/test/python/wlsdeploy/tool/extract/extract_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ def _extract_domain_resource(self, suffix):
130130
model_dict = translator.parse()
131131
model = Model(model_dict)
132132

133-
resource_file = os.path.join(self.EXTRACT_OUTPUT_DIR, 'domain-resource-' + suffix + '.yaml')
134133
args_map = {
135134
'-domain_home': '/u01/domain',
136135
'-oracle_home': '/oracle',
137-
'-domain_resource_file': resource_file,
136+
'-output_dir': self.EXTRACT_OUTPUT_DIR,
138137
'-target': 'wko'
139138
}
140139
model_context = ModelContext('ExtractTest', args_map)
@@ -143,5 +142,6 @@ def _extract_domain_resource(self, suffix):
143142
extractor = DomainResourceExtractor(model, model_context, aliases, self.__logger)
144143
extractor.extract()
145144

145+
resource_file = os.path.join(self.EXTRACT_OUTPUT_DIR, 'wko-domain.yaml')
146146
translator = FileToPython(resource_file, use_ordering=True)
147147
return translator.parse()

0 commit comments

Comments
 (0)