|
34 | 34 | VARIABLE_KEYWORDS_FILE_NAME_ARG = 'variable_keywords_file_name' |
35 | 35 | VARIABLE_INJECTOR_FILES_PATH_ARG = 'variable_injector_files_path_name' |
36 | 36 | VARIABLE_FILE_NAME_ARG = 'variable_file_name' |
37 | | -VARIABLE_FILE_NAME = 'variables.json' |
| 37 | +VARIABLE_FILE_NAME = 'variable.properties' |
38 | 38 | VARIABLE_FILE_APPEND_ARG = 'append_to_variables' |
39 | 39 | VARIABLE_FILE_APPEND = 'append' |
40 | 40 | VARIABLE_FILE_UPDATE = 'update' |
@@ -123,7 +123,7 @@ def inject_variables_keyword_file(self, **kwargs): |
123 | 123 | return_model = self.__original |
124 | 124 | variable_file_location = None |
125 | 125 | if variables_injector_dictionary and keywords_dictionary: |
126 | | - variable_file_location = self._get_variable_file_name(variables_injector_dictionary, **kwargs) |
| 126 | + variable_file_location = self._get_variable_file_name(**kwargs) |
127 | 127 | if not variable_file_location: |
128 | 128 | _logger.warning('WLSDPLY-19520', variable_injector_location_file, class_name=_class_name, |
129 | 129 | method_name=_method_name) |
@@ -471,17 +471,11 @@ def _log_mbean_not_found(self, mbean, replacement, location): |
471 | 471 | _logger.finer('WLSDPLY-19516', mbean, replacement, location.get_folder_path(), |
472 | 472 | class_name=_class_name, method_name=_method_name) |
473 | 473 |
|
474 | | - def _get_variable_file_name(self, variables_injector_dictionary, **kwargs): |
| 474 | + def _get_variable_file_name(self, **kwargs): |
475 | 475 | _method_name = '_get_variable_file_name' |
476 | 476 | if VARIABLE_FILE_NAME_ARG in kwargs: |
477 | 477 | variable_file_location = kwargs[VARIABLE_FILE_NAME_ARG] |
478 | 478 | _logger.finer('WLSDPLY-19522', variable_file_location, class_name=_class_name, method_name=_method_name) |
479 | | - if VARIABLE_FILE_NAME_ARG in variables_injector_dictionary: |
480 | | - del variables_injector_dictionary[VARIABLE_FILE_NAME_ARG] |
481 | | - elif VARIABLE_FILE_NAME_ARG in variables_injector_dictionary: |
482 | | - variable_file_location = variables_injector_dictionary[VARIABLE_FILE_NAME_ARG] |
483 | | - del variables_injector_dictionary[VARIABLE_FILE_NAME_ARG] |
484 | | - _logger.finer('WLSDPLY-19521', variable_file_location, class_name=_class_name, method_name=_method_name) |
485 | 479 | else: |
486 | 480 | variable_file_location = variables.get_default_variable_file_name(self.__model_context) |
487 | 481 | if variable_file_location: |
@@ -554,6 +548,15 @@ def _check_replace_variable_value(self, location, attribute, variable_value, inj |
554 | 548 | return variable_value |
555 | 549 |
|
556 | 550 |
|
| 551 | +def get_default_variable_injector_file_name(variable_injector_file_name=VARIABLE_INJECTOR_FILE_NAME): |
| 552 | + """ |
| 553 | + Return the default name and location of the model variable injector json file |
| 554 | + :param variable_injector_file_name: if different than the default name |
| 555 | + :return: file path in the wlsdeploy location and file name |
| 556 | + """ |
| 557 | + return os.path.join(_wlsdeploy_location, DEFAULT_FILE_LOCATION, variable_injector_file_name) |
| 558 | + |
| 559 | + |
557 | 560 | def _load_variable_file(variable_file_location, **kwargs): |
558 | 561 | _method_name = '_load_variable_file' |
559 | 562 | append = False |
@@ -581,7 +584,7 @@ def _get_variable_injector_file_name(**kwargs): |
581 | 584 | if VARIABLE_INJECTOR_PATH_NAME_ARG in kwargs: |
582 | 585 | return os.path.join(kwargs[VARIABLE_INJECTOR_PATH_NAME_ARG], variable_injector_file_name) |
583 | 586 | else: |
584 | | - return os.path.join(_wlsdeploy_location, DEFAULT_FILE_LOCATION, variable_injector_file_name) |
| 587 | + return get_default_variable_injector_file_name(variable_injector_file_name) |
585 | 588 |
|
586 | 589 |
|
587 | 590 | def _get_variable_keywords_file_name(**kwargs): |
|
0 commit comments