Skip to content

Commit 8bff6c5

Browse files
Minor tweeking for better code
1 parent 291990b commit 8bff6c5

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@
8181
SPACE_DELIMITED_STRING = 'delimited_string[space]'
8282
STRING = 'string'
8383

84+
ALIAS_DELIMITED_TYPES = [
85+
COMMA_DELIMITED_STRING,
86+
DELIMITED_STRING,
87+
PATH_SEPARATOR_DELIMITED_STRING,
88+
SEMI_COLON_DELIMITED_STRING,
89+
SPACE_DELIMITED_STRING
90+
]
91+
8492
ALIAS_LIST_TYPES = [
8593
COMMA_DELIMITED_STRING,
8694
DELIMITED_STRING,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
from wlsdeploy.aliases.alias_constants import WLST_SUBFOLDERS_PATH
5353
from wlsdeploy.aliases.alias_constants import WLST_TYPE
5454

55-
IGNORE_FOR_MODEL_LIST = ['DynamicallyCreated', 'Id', 'Tag', 'Tags', 'Type', 'Name']
5655
_class_name = 'AliasEntries'
5756
_logger = PlatformLogger('wlsdeploy.aliases')
5857

@@ -66,6 +65,8 @@ class AliasEntries(object):
6665
This class is intended only for use by aliases.py. Other uses of this class violate
6766
encapsulation and should be avoided.
6867
"""
68+
IGNORE_FOR_MODEL_LIST = ['DynamicallyCreated', 'Id', 'Tag', 'Tags', 'Type', 'Name', 'Parent']
69+
6970
__category_modules_dir_name = 'oracle/weblogic/deploy/aliases/category_modules/'
7071
__domain_category = 'Domain'
7172

@@ -744,7 +745,7 @@ def get_alias_attribute_entry_by_wlst_name(self, location, wlst_attribute_name):
744745
else:
745746
_logger.warning('WLSDPLY-08110', wlst_attribute_name, location.get_folder_path(), WLST_PATH)
746747
else:
747-
if wlst_attribute_name not in IGNORE_FOR_MODEL_LIST:
748+
if wlst_attribute_name not in self.IGNORE_FOR_MODEL_LIST:
748749
ex = exception_helper.create_alias_exception('WLSDPLY-08111', location.get_folder_path(),
749750
wlst_attribute_name)
750751
_logger.throwing(ex, class_name=_class_name, method_name=_method_name)

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,27 @@ def get_model_attribute_default_value(self, location, model_attribute_name):
10731073
self._logger.exiting(class_name=self._class_name, method_name=_method_name, result=default_value)
10741074
return default_value
10751075

1076+
def get_model_attribute_type(self, location, model_attribute_name):
1077+
"""
1078+
Get the wlst_type for the model attribute name at the specified location
1079+
:param location:
1080+
:param model_attribute_name:
1081+
:return:
1082+
"""
1083+
wlst_type = None
1084+
attribute_info = self._alias_entries.get_alias_attribute_entry_by_model_name(location, model_attribute_name)
1085+
if attribute_info is not None:
1086+
wlst_type = attribute_info[WLST_TYPE]
1087+
return wlst_type
1088+
1089+
def get_ignore_attribute_names(self):
1090+
"""
1091+
Return the list of attribute names that are ignored by the aliases and not defined in the alias category
1092+
json files.
1093+
:return: list of ignored attribute
1094+
"""
1095+
return self._alias_entries.IGNORE_FOR_MODEL_LIST
1096+
10761097
####################################################################################
10771098
#
10781099
# Private methods, private inner classes and static methods only, beyond here please

0 commit comments

Comments
 (0)