Skip to content

Commit e21dcf2

Browse files
CarolynRountreeddsharpe
authored andcommitted
Issue #504 handle defaults with mbean names (#509)
* alias definition changes for paths and object names * ignore file descriptor name in discover and create * ignore file descriptor name in discover and create
1 parent 95f7038 commit e21dcf2

File tree

14 files changed

+138
-117
lines changed

14 files changed

+138
-117
lines changed

core/src/main/python/wlsdeploy/aliases/alias_entries.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class AliasEntries(object):
7171
This class is intended only for use by aliases.py. Other uses of this class violate
7272
encapsulation and should be avoided.
7373
"""
74-
IGNORE_FOR_MODEL_LIST = ['DynamicallyCreated', 'Id', 'Tag', 'Tags', 'Type', 'Name', 'Parent']
74+
IGNORE_FOR_MODEL_LIST = ['DescriptorFileName', 'DynamicallyCreated', 'Id', 'Tag', 'Tags', 'Type', 'Name', 'Parent']
7575

7676
__category_modules_dir_name = 'oracle/weblogic/deploy/aliases/category_modules/'
7777
__domain_category = 'Domain'
@@ -711,7 +711,8 @@ def get_alias_attribute_entry_by_wlst_name(self, location, wlst_attribute_name):
711711

712712
_logger.entering(str(location), class_name=_class_name, method_name=_method_name)
713713
folder_dict = self.__get_dictionary_for_location(location, False)
714-
if self._is_wlst_attribute_skipped(folder_dict, wlst_attribute_name):
714+
if self._is_wlst_attribute_skipped(folder_dict, wlst_attribute_name) or \
715+
self._is_wlst_attribute_ignored(wlst_attribute_name):
715716
result = None
716717
elif folder_dict is not None and WLST_NAMES_MAP in folder_dict:
717718
if wlst_attribute_name in folder_dict[WLST_NAMES_MAP]:
@@ -1464,6 +1465,11 @@ def _is_wlst_attribute_skipped(self, folder_dict, wlst_attribute_name):
14641465
return wlst_attribute_name in skip_names
14651466
return False
14661467

1468+
def _is_wlst_attribute_ignored(self, wlst_attribute_name):
1469+
if wlst_attribute_name in self.IGNORE_FOR_MODEL_LIST:
1470+
return True
1471+
return False
1472+
14671473
def __get_path_for_location(self, location, path_type=WLST_ATTRIBUTES_PATH):
14681474
"""
14691475
Get the tokenized path of the specified type for the location. This method is used by all path-related methods.

core/src/main/python/wlsdeploy/aliases/aliases.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,9 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
951951
# always the model delimiter
952952
default_value = alias_utils.convert_to_type(model_type, default_value, delimiter=MODEL_LIST_DELIMITER)
953953

954+
if attribute_info[WLST_TYPE] == STRING:
955+
default_value = alias_utils.replace_tokens_in_path(location, default_value)
956+
954957
if model_type == 'password':
955958
if string_utils.is_empty(wlst_attribute_value) or converted_value == default_value:
956959
model_attribute_value = None

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Domain.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"ConfigBackupEnabled": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConfigBackupEnabled", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ],
2020
"ConfigurationAuditType": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConfigurationAuditType", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
2121
"ConfigurationVersion": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConfigurationVersion", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO" } ],
22-
"ConsoleContextPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConsoleContextPath", "wlst_path": "WP001", "value": {"default": "console" }, "wlst_type": "string" } ],
22+
"ConsoleContextPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConsoleContextPath", "wlst_path": "WP001", "value": {"default": "console" }, "wlst_type": "string", "uses_path_tokens": "true" } ],
2323
"ConsoleEnabled": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConsoleEnabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],
24-
"ConsoleExtensionDirectory": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConsoleExtensionDirectory", "wlst_path": "WP001", "value": {"default": "console-ext" }, "wlst_type": "string" } ],
24+
"ConsoleExtensionDirectory": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ConsoleExtensionDirectory", "wlst_path": "WP001", "value": {"default": "console-ext" }, "wlst_type": "string", "uses_path_tokens": "true" } ],
2525
"DbPassiveMode": [ {"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "${Db:DB}PassiveMode", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ],
2626
"DbPassiveModeGracePeriodSeconds": [ {"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "${Db:DB}PassiveModeGracePeriodSeconds", "wlst_path": "WP001", "value": {"default": 30 }, "wlst_type": "integer" } ],
2727
"DiagnosticContextCompatibilityModeEnabled": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "DiagnosticContextCompatibilityModeEnabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/JMSServer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
{"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "FileCount", "wlst_path": "WP001", "value": {"default": "${7:100}" }, "wlst_type": "integer" } ],
5252
"FileMinSize": [ {"version": "[10,12.2.1.3)", "wlst_mode": "both", "wlst_name": "FileMinSize", "wlst_path": "WP001", "value": {"default": 500 }, "wlst_type": "integer" } ,
5353
{"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "FileMinSize", "wlst_path": "WP001", "value": {"default": "${500:5000}" }, "wlst_type": "integer" } ],
54-
"FileName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "FileName", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "restart_required": "true" } ],
54+
"FileName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "FileName", "wlst_path": "WP001", "value": {"default": "logs/jmsServers/%JMSSERVER%/jms.messages.log" }, "wlst_type": "string", "restart_required": "true", "uses_path_tokens": "true" } ],
5555
"FileTimeSpan": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "FileTimeSpan", "wlst_path": "WP001", "value": {"default": 24 }, "wlst_type": "integer" } ],
5656
"FileTimeSpanFactor": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "FileTimeSpanFactor", "wlst_path": "WP001", "value": {"default": 3600000 }, "wlst_type": "long" } ],
57-
"LogFileRotationDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LogFileRotationDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
57+
"LogFileRotationDir": [ {"version": "[10,12.1.2)", "wlst_mode": "both", "wlst_name": "LogFileRotationDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true", "get_method": "${LSA:GET}" } ],
5858
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
5959
"NumberOfFilesLimited": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "NumberOfFilesLimited", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],
6060
"RotateLogOnStartup": [ {"version": "[10,12.2.1.3)", "wlst_mode": "both", "wlst_name": "RotateLogOnStartup", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ,
@@ -91,7 +91,7 @@
9191
"MessagesThresholdLow": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "MessagesThresholdLow", "wlst_path": "WP001", "value": {"default": -1 }, "wlst_type": "long" } ],
9292
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
9393
"PagingBlockSize": [ {"version": "[10.3.4,)", "wlst_mode": "both", "wlst_name": "PagingBlockSize", "wlst_path": "WP001", "value": {"default": -1 }, "wlst_type": "integer", "restart_required": "true" } ],
94-
"PagingDirectory": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PagingDirectory", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" , "restart_required": "true" } ],
94+
"PagingDirectory": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PagingDirectory", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" , "uses_path_tokens": "true", "restart_required": "true" } ],
9595
"PagingFileLockingEnabled": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PagingFileLockingEnabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean", "restart_required": "true" } ],
9696
"PagingIoBufferSize": [ {"version": "[10.3.4,)", "wlst_mode": "both", "wlst_name": "PagingIoBufferSize", "wlst_path": "WP001", "value": {"default": -1 }, "wlst_type": "integer", "restart_required": "true" } ],
9797
"PagingMaxFileSize": [ {"version": "[10.3.4,)", "wlst_mode": "both", "wlst_name": "PagingMaxFileSize", "wlst_path": "WP001", "value": {"default": 1342177280 }, "wlst_type": "long", "restart_required": "true" } ],

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Log.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
{"version": "[12.2.1.3,)","wlst_mode": "both", "wlst_name": "FileCount", "wlst_path": "WP001", "value": {"default": "${7:100}"}, "wlst_type": "integer"} ],
1818
"FileMinSize": [ {"version": "[10,12.2.1.3)","wlst_mode": "both", "wlst_name": "FileMinSize", "wlst_path": "WP001", "value": {"default": 500 }, "wlst_type": "integer"} ,
1919
{"version": "[12.2.1.3,)","wlst_mode": "both", "wlst_name": "FileMinSize", "wlst_path": "WP001", "value": {"default": "${500:5000}"}, "wlst_type": "integer"} ],
20-
"FileName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "FileName", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
20+
"FileName": [ {"version": "[10,12.1.2)", "wlst_mode": "both", "wlst_name": "FileName", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" },
21+
{"version": "[12.1.3,)", "wlst_mode": "both", "wlst_name": "FileName", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true" } ],
2122
"FileTimeSpan": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "FileTimeSpan", "wlst_path": "WP001", "value": {"default": 24 }, "wlst_type": "integer"} ],
2223
"FileTimeSpanFactor": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "FileTimeSpanFactor", "wlst_path": "WP001", "value": {"default": 3600000 }, "wlst_type": "long" } ],
2324
"Log4jLoggingEnabled": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Log4jLoggingEnabled", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean", "restart_required": "true"} ],
2425
"LogFileFilter": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LogFileFilter", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "set_method": "MBEAN.set_log_filter_mbean", "set_mbean_type": "weblogic.management.configuration.LogFilterMBean" } ],
25-
"LogFileRotationDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LogFileRotationDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
26+
"LogFileRotationDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LogFileRotationDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true" } ],
2627
"LogFileSeverity": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LogFileSeverity", "wlst_path": "WP001", "value": {"default": "${None:Trace}"}, "wlst_type": "string" } ],
2728
"LogMonitoringEnabled": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LogMonitoringEnabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean"} ],
2829
"LogMonitoringIntervalSecs": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LogMonitoringIntervalSecs", "wlst_path": "WP001", "value": {"default": 30 }, "wlst_type": "integer"} ],

0 commit comments

Comments
 (0)