Skip to content

Commit 776a738

Browse files
authored
Errors setting boolean values in SecurityConfiguration attributes (#748)
* JIRA WDT-485 - Use set_boolean attribute setter for problematic LDAP security attributes * JIRA WDT-485 - Use set_boolean attribute setter other security MBeans; corrected some online attribute names
1 parent 4d091e3 commit 776a738

File tree

2 files changed

+50
-33
lines changed

2 files changed

+50
-33
lines changed

core/src/main/python/wlsdeploy/tool/util/attribute_setter.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from org.python.modules import jarray
77

88
from wlsdeploy.aliases import alias_utils
9+
from wlsdeploy.aliases.alias_constants import BOOLEAN
910
from wlsdeploy.aliases.alias_jvmargs import JVMArguments
1011
from wlsdeploy.aliases.location_context import LocationContext
1112
from wlsdeploy.aliases.model_constants import CAPACITY
@@ -634,6 +635,22 @@ def set_jvm_args(self, location, key, value, wlst_value):
634635
self.set_attribute(location, key, result, wlst_merge_value=wlst_value, use_raw_value=True)
635636
return
636637

638+
def set_boolean(self, location, key, value, wlst_value):
639+
"""
640+
Set the specified attribute with a Jython boolean primitive value.
641+
By default in WDT, boolean attributes are converted to string values for assignment.
642+
Some attributes can only be assigned consistently using a boolean primitive, using this attribute setter.
643+
:param location: the location
644+
:param key: the attribute name
645+
:param value: the string value
646+
:param wlst_value: the existing value of the attribute from WLST
647+
:raises BundleAwareException of the specified type: if target is not found
648+
"""
649+
result = alias_utils.convert_to_type(BOOLEAN, value)
650+
result = result == 'true'
651+
self.set_attribute(location, key, result, wlst_merge_value=wlst_value, use_raw_value=True)
652+
return
653+
637654
#
638655
# public set_attribute convenience methods
639656
#

0 commit comments

Comments
 (0)