Skip to content

Commit cb19b1f

Browse files
CarolynRountreeddsharpe
authored andcommitted
Wdt#350 do not log skipped method (#476)
* Jira#WDT-350-remove-skip-log-message * Jira#WDT-log-set-attribute
1 parent e4a62fd commit cb19b1f

File tree

6 files changed

+54
-2
lines changed

6 files changed

+54
-2
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,29 @@ def get_model_password_attribute_names(self, location):
841841

842842
return model_attribute_names
843843

844+
def is_model_password_attribute(self, location, model_name):
845+
"""
846+
Determine if the attribute with the specified model_name is a password attribute.
847+
:param location: current location context
848+
:param model_name: specified model name to check if password
849+
:return: True if the wlst type is password
850+
"""
851+
_method_name = 'is_model_password_attribute'
852+
853+
is_password = False
854+
module_folder = self._alias_entries.get_dictionary_for_location(location, resolve=False)
855+
856+
if ATTRIBUTES not in module_folder:
857+
ex = exception_helper.create_alias_exception('WLSDPLY-08400', location.get_folder_path())
858+
self._logger.throwing(ex, class_name=self._class_name, method_name=_method_name)
859+
raise ex
860+
861+
if model_name in module_folder[ATTRIBUTES] and WLST_TYPE in module_folder[ATTRIBUTES][model_name] and \
862+
module_folder[ATTRIBUTES][model_name][WLST_TYPE] == PASSWORD:
863+
is_password = True
864+
865+
return is_password
866+
844867
def get_model_uses_path_tokens_attribute_names(self, location):
845868
"""
846869
Get the list of attribute names that "use path tokens" (i.e., ones whose values are file system paths).

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@
318318
INSTALL_DIR = 'InstallDir'
319319
LISTEN_ADDRESS = 'ListenAddress'
320320
LISTEN_PORT = 'ListenPort'
321+
MASKED_PASSWORD = '<Masked>'
321322
MIME_MAPPING_FILE = 'MimeMappingFile'
322323
NAME = 'Name'
323324
NOTIFICATION = 'Notification'

core/src/main/python/wlsdeploy/tool/deploy/deployer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ def _skip_setting_attribute(self, key, value, wlst_merge_value, restart_attribut
206206
:return: True if the attribute does not need to be set
207207
"""
208208
_method_name = '_skip_setting_attribute'
209-
self.logger.entering(str(key), str(value), str(wlst_merge_value), str(restart_attribute_names),
210-
class_name=self._class_name, method_name=_method_name)
211209

212210
# Needs implementation. Return true if model key in restart attribute_names,
213211
# and WLST helper determines that set is required,

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,24 @@ def get_model_password_type_attribute_names(self, location):
487487
raise ex
488488
return password_attribute_names
489489

490+
def is_model_password_attribute(self, location, model_name):
491+
"""
492+
Determine if the model attribute at the location is a password type.
493+
:param location: current location context
494+
:param model_name: attribute model name in alias definitions
495+
:return: True if the attribute is a password type
496+
"""
497+
_method_name = 'is_model_password_attribute'
498+
499+
try:
500+
is_password = self.__aliases.is_model_password_attribute(location, model_name)
501+
except AliasException, ae:
502+
ex = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-19040', model_name,
503+
location.get_folder_path(), ae.getLocalizedMessage(), error=ae)
504+
self.__logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
505+
raise ex
506+
return is_password
507+
490508
def get_model_mbean_set_method_attribute_names_and_types(self, location):
491509
"""
492510
Get the list of model attribute names and types where the set method requires an MBean.

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from wlsdeploy.aliases.model_constants import LOG_ACTION
4141
from wlsdeploy.aliases.model_constants import LOG_FILTER
4242
from wlsdeploy.aliases.model_constants import MACHINE
43+
from wlsdeploy.aliases.model_constants import MASKED_PASSWORD
4344
from wlsdeploy.aliases.model_constants import MAX_THREADS_CONSTRAINT
4445
from wlsdeploy.aliases.model_constants import MIGRATABLE_TARGET
4546
from wlsdeploy.aliases.model_constants import MIN_THREADS_CONSTRAINT
@@ -660,6 +661,15 @@ def set_attribute(self, location, model_key, model_value, wlst_merge_value=None,
660661
self.__logger.info('WLSDPLY-20012', model_key, str(model_value),
661662
class_name=self._class_name, method_name=_method_name)
662663
else:
664+
if self.__logger.is_finer_enabled():
665+
print_model_value = model_value
666+
print_wlst_value = wlst_value
667+
if self.__alias_helper.is_model_password_attribute(location, model_key):
668+
print_model_value = MASKED_PASSWORD
669+
print_wlst_value = MASKED_PASSWORD
670+
self.__logger.finer('WLSDPLY-19211', wlst_param, print_model_value, print_wlst_value,
671+
location.get_folder_path(), class_name=self._class_name, method_name=_method_name)
672+
663673
self.__wlst_helper.set(wlst_param, wlst_value)
664674
return
665675

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,7 @@ WLSDPLY-19036=Failed to determine if the location ({0}) is a security provider:
12751275
WLSDPLY-19037=Failed to decrypt password: {0}
12761276
WLSDPLY-19038=List of attribute names to ignore for all MBeans {0}
12771277
WLSDPLY-19039=Failed to convert the wlst attribute name to the model name at location ({0}) : {1}
1278+
WLSDPLY-19040=Failed to determine if the model attributes {0} is a password for location ({0}): {1}
12781279

12791280
# wlsdeploy/tool/util/wlst_helper.py
12801281
WLSDPLY-19100=Failed to change to the WLST directory {0}: {1}
@@ -1339,6 +1340,7 @@ WLSDPLY-19207=Unable to locate resource manager {0} for partition {1}
13391340
WLSDPLY-19208=Unable to locate log filter {0} for log at location {1}
13401341
WLSDPLY-19209=Assign {0} {1} to {2} {3}
13411342
WLSDPLY-19210={0} {1} not found in location {2}
1343+
WLSDPLY-19211=Setting attribute {0} with model value {1} to value {2} in location {3}
13421344

13431345
# wlsdeploy/tool/util/archive_helper.py
13441346
WLSDPLY-19300=Failed to open archive file {0}: {1}

0 commit comments

Comments
 (0)