|
6 | 6 | from org.python.modules import jarray
|
7 | 7 |
|
8 | 8 | from wlsdeploy.aliases import alias_utils
|
| 9 | +from wlsdeploy.aliases.alias_constants import BOOLEAN |
9 | 10 | from wlsdeploy.aliases.alias_jvmargs import JVMArguments
|
10 | 11 | from wlsdeploy.aliases.location_context import LocationContext
|
11 | 12 | from wlsdeploy.aliases.model_constants import CAPACITY
|
@@ -634,6 +635,22 @@ def set_jvm_args(self, location, key, value, wlst_value):
|
634 | 635 | self.set_attribute(location, key, result, wlst_merge_value=wlst_value, use_raw_value=True)
|
635 | 636 | return
|
636 | 637 |
|
| 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 | + |
637 | 654 | #
|
638 | 655 | # public set_attribute convenience methods
|
639 | 656 | #
|
|
0 commit comments