Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/python/wlsdeploy/aliases/alias_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
MBEAN = 'MBEAN'

# ACCESS values
RO = 'RO' # Read only
ROD = 'ROD' # Read only but discover
RW = 'RW' # Default Read WRITE
IGNORED = 'IGNORED' # Ignored
RO = 'RO' # Read-only (discovered but never written)
RW = 'RW' # Default Read-write

# used when DEFAULT_VALUE has curly-brace value that resolves to null
NULL_VALUE_KEY = '__NULL__'
Expand Down
42 changes: 21 additions & 21 deletions core/src/main/python/wlsdeploy/aliases/aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from wlsdeploy.aliases.alias_constants import FOLDERS
from wlsdeploy.aliases.alias_constants import GET
from wlsdeploy.aliases.alias_constants import GET_METHOD
from wlsdeploy.aliases.alias_constants import IGNORED
from wlsdeploy.aliases.alias_constants import JARRAY
from wlsdeploy.aliases.alias_constants import LIST
from wlsdeploy.aliases.alias_constants import LSA
Expand All @@ -35,7 +36,6 @@
from wlsdeploy.aliases.alias_constants import PROPERTIES
from wlsdeploy.aliases.alias_constants import RESTART_REQUIRED
from wlsdeploy.aliases.alias_constants import RO
from wlsdeploy.aliases.alias_constants import ROD
from wlsdeploy.aliases.alias_constants import SET_MBEAN_TYPE
from wlsdeploy.aliases.alias_constants import SET_METHOD
from wlsdeploy.aliases.alias_constants import STRING
Expand Down Expand Up @@ -509,7 +509,7 @@ def get_wlst_attribute_name_and_value(self, location, model_attribute_name, mode

attribute_info = module_folder[ATTRIBUTES][model_attribute_name]

if attribute_info and not self.__is_wlst_attribute_read_only(location, attribute_info):
if attribute_info and not self.__is_wlst_attribute_read_only_or_ignored(location, attribute_info):
wlst_attribute_name = attribute_info[WLST_NAME]
uses_path_tokens = USES_PATH_TOKENS in attribute_info and \
string_utils.to_boolean(attribute_info[USES_PATH_TOKENS])
Expand Down Expand Up @@ -614,7 +614,7 @@ def get_wlst_attribute_name(self, location, model_attribute_name, check_read_onl
self._alias_entries.get_alias_attribute_entry_by_model_name(location, model_attribute_name)

if alias_attr_dict is not None and (not check_read_only or not
self.__is_wlst_attribute_read_only(location, alias_attr_dict)):
self.__is_wlst_attribute_read_only_or_ignored(location, alias_attr_dict)):
if WLST_NAME in alias_attr_dict:
wlst_attribute_name = alias_attr_dict[WLST_NAME]
else:
Expand Down Expand Up @@ -656,14 +656,14 @@ def get_wlst_get_required_attribute_names(self, location):
self._raise_exception(ae, _method_name, 'WLSDPLY-19020', location.get_current_model_folder(),
location.get_folder_path(), ae.getLocalizedMessage())

def get_wlst_access_rod_attribute_names(self, location):
def get_wlst_access_ro_attribute_names(self, location):
"""
Get the list of attribute names that have their ACCESS type set to ROD (readonly but discover)
Get the list of attribute names that have their ACCESS type set to RO (readonly)
:param location: the location
:return: list[string]: the list of attribute names
:raises: Tool type exception: if an error occurs due to a bad location or bad alias data
"""
_method_name = 'get_wlst_access_rod_attribute_names'
_method_name = 'get_wlst_access_ro_attribute_names'

try:
wlst_attribute_names = []
Expand All @@ -676,7 +676,7 @@ def get_wlst_access_rod_attribute_names(self, location):
raise ex

for key, value in module_folder[ATTRIBUTES].iteritems():
if ACCESS in value and value[ACCESS] == ROD:
if ACCESS in value and value[ACCESS] == RO:
wlst_attribute_names.append(value[WLST_NAME])

return wlst_attribute_names
Expand Down Expand Up @@ -1041,7 +1041,7 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
model_attribute_value = None

attribute_info = self._alias_entries.get_alias_attribute_entry_by_wlst_name(location, wlst_attribute_name)
if attribute_info is not None and not self.__is_model_attribute_read_only(location, attribute_info):
if attribute_info is not None and not self.__is_model_attribute_ignored(location, attribute_info):
data_type, preferred_type, delimiter = \
alias_utils.compute_read_data_type_for_wlst_and_delimiter_from_attribute_info(attribute_info,
wlst_attribute_value)
Expand Down Expand Up @@ -1112,14 +1112,14 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
self._raise_exception(ae, _method_name, 'WLSDPLY-19028', str_helper.to_string(location),
ae.getLocalizedMessage())

def get_model_attribute_name(self, location, wlst_attribute_name, check_read_only=True):
def get_model_attribute_name(self, location, wlst_attribute_name, exclude_ignored=True):
"""
Returns the model attribute name for the specified WLST attribute name and value. If the model attribute name
is not valid for the version or the attribute is marked as read-only, return None

:param location: the location
:param wlst_attribute_name: the WLST attribute name
:param check_read_only: Defaults to True. If False, return the WLST attribute name even if read only
:param exclude_ignored: Defaults to True. If False, return the WLST attribute name even if ignored
:return: matching model attribute name
:raises: Tool type exception: if an error occurs
"""
Expand All @@ -1132,7 +1132,7 @@ def get_model_attribute_name(self, location, wlst_attribute_name, check_read_onl

attribute_info = self._alias_entries.get_alias_attribute_entry_by_wlst_name(location, wlst_attribute_name)
if attribute_info is not None and \
(not check_read_only or not self.__is_model_attribute_read_only(location, attribute_info)):
(not exclude_ignored or not self.__is_model_attribute_ignored(location, attribute_info)):
model_attribute_name = attribute_info[MODEL_NAME]

self._logger.exiting(class_name=self._class_name, method_name=_method_name,
Expand Down Expand Up @@ -1451,33 +1451,33 @@ def get_model_type_and_name(self, location):
#
####################################################################################

def __is_model_attribute_read_only(self, location, attribute_info):
def __is_model_attribute_ignored(self, location, attribute_info):
"""
Is the model attribute read-only?
Is the model attribute ignored?
:param location: the location
:param attribute_info: the attribute tuple
:return: True if the attribute is read-only, False otherwise
:return: True if the attribute is ignored, False otherwise
"""
_method_name = '__is_model_attribute_read_only'
_method_name = '__is_model_attribute_ignored'
rtnval = False
if ACCESS in attribute_info and attribute_info[ACCESS] == RO:
if ACCESS in attribute_info and attribute_info[ACCESS] == IGNORED:
self._logger.finer('WLSDPLY-08409', attribute_info[MODEL_NAME], location.get_folder_path(),
WlstModes.from_value(self._wlst_mode),
class_name=self._class_name, method_name=_method_name)
rtnval = True

return rtnval

def __is_wlst_attribute_read_only(self, location, attribute_info):
def __is_wlst_attribute_read_only_or_ignored(self, location, attribute_info):
"""
Is the wlst attribute read-only?
Is the wlst attribute ignored or read-only?
:param location: the location
:param attribute_info: the attribute tuple
:return: True if the attribute is read-only, False otherwise
:return: True if the attribute is ignored or read-only, False otherwise
"""
_method_name = '__is_wlst_attribute_read_only'
_method_name = '__is_wlst_attribute_read_only_or_ignored'
rtnval = False
if ACCESS in attribute_info and attribute_info[ACCESS] in (RO, ROD):
if ACCESS in attribute_info and attribute_info[ACCESS] in (IGNORED, RO):
self._logger.finer('WLSDPLY-08411', attribute_info[MODEL_NAME], location.get_folder_path(),
WlstModes.from_value(self._wlst_mode),
class_name=self._class_name, method_name=_method_name)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/python/wlsdeploy/tool/discover/discoverer.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def _get_attributes_for_current_location(self, location):
def _is_defined_attribute(self, location, wlst_name):
attribute = False
try:
if self._aliases.get_model_attribute_name(location, wlst_name, check_read_only=False):
if self._aliases.get_model_attribute_name(location, wlst_name, exclude_ignored=False):
attribute = True
except DiscoverException:
pass
Expand Down
Loading