Skip to content

Commit a7caa7a

Browse files
authored
Fix alias attributes causing "not defined" messages in online discover (#1419)
* Allow comment field for alias attributes * Fix alias attributes causing "not defined" messages in online discover
1 parent 852d398 commit a7caa7a

File tree

6 files changed

+41
-2
lines changed

6 files changed

+41
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ACCESS = 'access'
1010
ATTRIBUTES = 'attributes'
1111
CHILD_FOLDERS_TYPE = 'child_folders_type'
12+
COMMENT = 'comment'
1213
CONTAINS = 'contains'
1314
DEFAULT_NAME_VALUE = 'default_name_value'
1415
DEFAULT_VALUE = 'default_value'

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
158158
"PanicAction": [ {"version": "[10,12.2.1)", "wlst_mode": "both", "wlst_name": "PanicAction", "wlst_path": "WP001", "default_value": "${__NULL__:no-action}", "derived_default": "${:true}", "wlst_type": "string" } ,
159159
{"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "PanicAction", "wlst_path": "WP001", "default_value": "${__NULL__:system-exit}", "derived_default": "${:true}", "wlst_type": "string" } ],
160+
"ServerFailureTrigger": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "ServerFailureTrigger", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "IGNORED", "comment": "Appears in attribute list until ServerFailureTrigger folder is created"} ],
160161
"SharedCapacityForWorkManagers": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "SharedCapacityForWorkManagers", "wlst_path": "WP001", "default_value": 65536, "derived_default": "${:true}", "wlst_type": "integer" } ]
161162

162163
},

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@
438438
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
439439
"PanicAction": [ {"version": "[10,12.2.1)", "wlst_mode": "both", "wlst_name": "PanicAction", "wlst_path": "WP001", "default_value": "${__NULL__:no-action}", "derived_default": "${:true}", "wlst_type": "string" } ,
440440
{"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "PanicAction", "wlst_path": "WP001", "default_value": "${__NULL__:system-exit}", "derived_default": "${:true}", "wlst_type": "string" } ],
441+
"ServerFailureTrigger": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "ServerFailureTrigger", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "IGNORED", "comment": "Appears in attribute list until ServerFailureTrigger folder is created"} ],
441442
"SharedCapacityForWorkManagers": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "SharedCapacityForWorkManagers", "wlst_path": "WP001", "default_value": 65536, "derived_default": "${:true}", "wlst_type": "integer"} ]
442443
},
443444
"wlst_attributes_path": "WP001",
@@ -1015,6 +1016,7 @@
10151016
"PreferredStoreSizeLimit": [ {"version": "[10,)" , "wlst_mode": "both", "wlst_name": "PreferredStoreSizeLimit", "wlst_path": "WP001", "default_value": 100, "wlst_type": "integer"} ],
10161017
"StoreSizeCheckPeriod": [ {"version": "[10,)" , "wlst_mode": "both", "wlst_name": "StoreSizeCheckPeriod", "wlst_path": "WP001", "default_value": 1, "wlst_type": "integer"} ],
10171018
"SynchronousEventPersistenceEnabled": [ {"version": "[10,)" , "wlst_mode": "both", "wlst_name": "SynchronousEventPersistenceEnabled", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean"} ],
1019+
"WLDFBuiltinSystemResourceDescriptorBean": [ {"version": "[12.1.2,)", "wlst_mode": "online", "wlst_name": "W${ldf:LDF}BuiltinSystemResourceDescriptorBean", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "IGNORED", "comment": "Transient attribute for inaccessible WLDFBuiltinSystemResourceDescriptorBean folder" } ],
10181020
"WldfBuiltinSystemResourceType": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "W${ldf:LDF}BuiltinSystemResourceType", "wlst_path": "WP001", "default_value": "${__NULL__:None}", "production_default": "${__NULL__:Low}", "wlst_type": "string" } ],
10191021
"WldfDiagnosticVolume": [ {"version": "[10,)" , "wlst_mode": "both", "wlst_name": "${Wldf:WLDF}DiagnosticVolume", "wlst_path": "WP001", "default_value": "${__NULL__:Low}", "wlst_type": "string" } ]
10201022
},
@@ -1608,6 +1610,7 @@
16081610
"JMSThreadPoolSize": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JMSThreadPoolSize", "wlst_path": "WP001", "default_value": 15, "wlst_type": "integer", "get_method": "${LSA:GET}" } ],
16091611
"JNDITransportableObjectFactoryList": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JNDITransportableObjectFactoryList", "wlst_path": "WP001", "default_value": null, "wlst_type": "jarray", "preferred_model_type": "delimited_string", "get_method": "GET" } ],
16101612
"JRMPEnabled": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "JRMPEnabled", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean", "get_method": "LSA"} ],
1613+
"JTAMigratableTarget": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "JTAMigratableTarget", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "IGNORED", "comment": "Appears in attribute list until JTAMigratableTarget folder is established"} ],
16111614
"JavaCompiler": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JavaCompiler", "wlst_path": "WP001", "default_value": "javac", "wlst_type": "string" } ],
16121615
"JavaCompilerPostClassPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JavaCompilerPostClassPath", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
16131616
"JavaCompilerPreClassPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "JavaCompilerPreClassPath", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
"LogMonitoringThrottleThreshold": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LogMonitoringThrottleThreshold", "wlst_path": "WP001", "default_value": 1500, "wlst_type": "integer"} ],
302302
"LoggerSeverity": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "LoggerSeverity", "wlst_path": "WP001", "default_value": "${__NULL__:Info}", "wlst_type": "string" } ],
303303
"LoggerSeverityProperties": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "LoggerSeverityProperties", "wlst_path": "WP001", "default_value": null, "wlst_type": "properties", "preferred_model_type": "dict", "get_method": "GET"} ],
304-
"MemoryBufferFilter": [ {"version": "[12.1.2)", "wlst_mode": "both", "wlst_name": "MemoryBufferFilter", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "set_method": "MBEAN.set_log_filter_mbean", "set_mbean_type": "weblogic.management.configuration.LogFilterMBean" } ],
304+
"MemoryBufferFilter": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "MemoryBufferFilter", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "set_method": "MBEAN.set_log_filter_mbean", "set_mbean_type": "weblogic.management.configuration.LogFilterMBean" } ],
305305
"MemoryBufferSeverity": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "MemoryBufferSeverity", "wlst_path": "WP001", "default_value": "${__NULL__:Trace}", "wlst_type": "string" } ],
306306
"MemoryBufferSize": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "MemoryBufferSize", "wlst_path": "WP001", "default_value": 10, "production_default": "${__NULL__:500}", "wlst_type": "integer"} ],
307307
"Notes": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
@@ -450,6 +450,7 @@
450450
"Notes": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
451451
"PanicAction": [ {"version": "[12.1.2,12.2.1)", "wlst_mode": "both", "wlst_name": "PanicAction", "wlst_path": "WP001", "default_value": "${__NULL__:no-action}", "derived_default": "${:true}", "wlst_type": "string" } ,
452452
{"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "PanicAction", "wlst_path": "WP001", "default_value": "${__NULL__:system-exit}", "derived_default": "${:true}", "wlst_type": "string" } ],
453+
"ServerFailureTrigger": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "ServerFailureTrigger", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "IGNORED", "comment": "Appears in attribute list until ServerFailureTrigger folder is created"} ],
453454
"SharedCapacityForWorkManagers": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "SharedCapacityForWorkManagers", "wlst_path": "WP001", "default_value": 65536, "derived_default": "${:true}", "wlst_type": "integer"} ]
454455
},
455456
"wlst_attributes_path": "WP001",
@@ -1024,6 +1025,7 @@
10241025
"PreferredStoreSizeLimit": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "PreferredStoreSizeLimit", "wlst_path": "WP001", "default_value": 100, "wlst_type": "integer" } ],
10251026
"StoreSizeCheckPeriod": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "StoreSizeCheckPeriod", "wlst_path": "WP001", "default_value": 1, "wlst_type": "integer" } ],
10261027
"SynchronousEventPersistenceEnabled": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "SynchronousEventPersistenceEnabled", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean" } ],
1028+
"WLDFBuiltinSystemResourceDescriptorBean": [ {"version": "[12.1.2,)", "wlst_mode": "online", "wlst_name": "W${ldf:LDF}BuiltinSystemResourceDescriptorBean", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "IGNORED", "comment": "Transient attribute for inaccessible WLDFBuiltinSystemResourceDescriptorBean folder" } ],
10271029
"WldfBuiltinSystemResourceType": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "W${ldf:LDF}BuiltinSystemResourceType", "wlst_path": "WP001", "default_value": "${__NULL__:None}", "production_default": "${__NULL__:Low}", "wlst_type": "string" } ],
10281030
"WldfDiagnosticVolume": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "W${ldf:LDF}DiagnosticVolume", "wlst_path": "WP001", "default_value": "${__NULL__:Low}", "wlst_type": "string" } ]
10291031
},
@@ -1629,6 +1631,7 @@
16291631
"JMSThreadPoolSize": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "JMSThreadPoolSize", "wlst_path": "WP001", "default_value": 15, "wlst_type": "integer", "get_method": "${LSA:GET}" } ],
16301632
"JNDITransportableObjectFactoryList": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "JNDITransportableObjectFactoryList", "wlst_path": "WP001", "default_value": null, "wlst_type": "jarray", "preferred_model_type": "delimited_string", "get_method": "GET" } ],
16311633
"JRMPEnabled": [ {"version": "[12.1.2,)", "wlst_mode": "offline", "wlst_name": "JRMPEnabled", "wlst_path": "WP001", "default_value": "false", "wlst_type": "boolean" } ],
1634+
"JTAMigratableTarget": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "JTAMigratableTarget", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "access": "IGNORED", "comment": "Appears in attribute list until JTAMigratableTarget folder is established"} ],
16321635
"JavaCompiler": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "JavaCompiler", "wlst_path": "WP001", "default_value": "javac", "wlst_type": "string" } ],
16331636
"JavaCompilerPostClassPath": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "JavaCompilerPostClassPath", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
16341637
"JavaCompilerPreClassPath": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "JavaCompilerPreClassPath", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],

core/src/test/python/alias_json_file_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from wlsdeploy.aliases.alias_constants import ALIAS_DATA_TYPES
2525
from wlsdeploy.aliases.alias_constants import ATTRIBUTES
2626
from wlsdeploy.aliases.alias_constants import CHILD_FOLDERS_TYPE
27+
from wlsdeploy.aliases.alias_constants import COMMENT
2728
from wlsdeploy.aliases.alias_constants import CONTAINS
2829
from wlsdeploy.aliases.alias_constants import DEFAULT_NAME_VALUE
2930
from wlsdeploy.aliases.alias_constants import DEFAULT_VALUE
@@ -113,6 +114,7 @@ class ListTestCase(unittest.TestCase):
113114

114115
_optional_attribute_keys = [
115116
ACCESS,
117+
COMMENT,
116118
DERIVED_DEFAULT,
117119
GET_MBEAN_TYPE,
118120
GET_METHOD,
@@ -516,6 +518,14 @@ def _verify_attribute_access_attribute_value(self, folder_name, attribute_name,
516518
self._known_access_attribute_values, True))
517519
return result
518520

521+
def _verify_attribute_comment_attribute_value(self, folder_name, attribute_name, alias_attribute_value):
522+
result = []
523+
if type(alias_attribute_value) is not str:
524+
message = self._get_invalid_attribute_string_type_message(folder_name, attribute_name,
525+
COMMENT, alias_attribute_value)
526+
result.append(message)
527+
return result
528+
519529
def _verify_attribute_get_mbean_type_attribute_value(self, folder_name, attribute_name, alias_attribute_value):
520530
result = []
521531
if type(alias_attribute_value) is not str:

integration-tests/alias-test/verify/src/test/python/aliastest/verify/utils.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2020, 2022, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2023, 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 random
@@ -34,15 +34,36 @@
3434
}
3535

3636
ONLINE_ALIAS_ATTRIBUTE_IGNORE_MAP = {
37+
'/Cluster/OverloadProtection': [
38+
'ServerFailureTrigger' # appears in attribute list until folder MBean is created
39+
],
40+
'/Server': [
41+
'JTAMigratableTarget' # appears in attribute list until folder MBean is created
42+
],
43+
'/Server/OverloadProtection': [
44+
'ServerFailureTrigger' # appears in attribute list until folder MBean is created
45+
],
3746
'/Server/ServerDebug': [
3847
'DebugJAXPOutputStream',
3948
'DebugXMLRegistryOutputStream',
4049
'DebugXMLEntityCacheOutputStream'
4150
],
51+
'/Server/ServerDiagnosticConfig': [
52+
'WLDFBuiltinSystemResourceDescriptorBean'
53+
],
54+
'/ServerTemplate': [
55+
'JTAMigratableTarget' # appears in attribute list until folder MBean is created
56+
],
57+
'/ServerTemplate/OverloadProtection': [
58+
'ServerFailureTrigger' # appears in attribute list until folder MBean is created
59+
],
4260
'/ServerTemplate/ServerDebug': [
4361
'DebugJAXPOutputStream',
4462
'DebugXMLRegistryOutputStream',
4563
'DebugXMLEntityCacheOutputStream'
64+
],
65+
'/ServerTemplate/ServerDiagnosticConfig': [
66+
'WLDFBuiltinSystemResourceDescriptorBean'
4667
]
4768
}
4869

0 commit comments

Comments
 (0)