|
22 | 22 | from wlsdeploy.logging.platform_logger import PlatformLogger
|
23 | 23 | from wlsdeploy.tool.discover import discoverer
|
24 | 24 | from wlsdeploy.tool.discover.discoverer import Discoverer
|
| 25 | +from wlsdeploy.tool.util.variable_injector import VARIABLE_SEP |
25 | 26 | from wlsdeploy.tool.util.wlst_helper import WlstHelper
|
26 |
| -from wlsdeploy.util import path_utils |
27 | 27 | from wlsdeploy.util import string_utils
|
| 28 | +from wlsdeploy.util import variables |
| 29 | + |
28 | 30 |
|
29 | 31 | _class_name = 'TopologyDiscoverer'
|
30 | 32 | _logger = PlatformLogger(discoverer.get_discover_logger_name())
|
@@ -320,7 +322,7 @@ def discover_security_configuration(self):
|
320 | 322 | _logger.info('WLSDPLY-06622', class_name=_class_name, method_name=_method_name)
|
321 | 323 | location.add_name_token(self._aliases.get_name_token(location), security_configuration)
|
322 | 324 | self._populate_model_parameters(result, location)
|
323 |
| - self._massage_security_credential(result) |
| 325 | + self._massage_security_credential(result, location) |
324 | 326 | try:
|
325 | 327 | self._discover_subfolders(result, location)
|
326 | 328 | except DiscoverException, de:
|
@@ -477,22 +479,34 @@ def _get_xml_registries(self):
|
477 | 479 | _logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
|
478 | 480 | return model_top_folder_name, result
|
479 | 481 |
|
480 |
| - def _massage_security_credential(self, result): |
| 482 | + def _massage_security_credential(self, result, location): |
481 | 483 | _method_name = 'massage_security_credential'
|
482 | 484 | # Determine if the SecurityConfiguration/CredentialEncrypted can be removed
|
| 485 | + pass_cache = OrderedDict() |
| 486 | + short_name = '' |
| 487 | + if self._variable_injector is not None: |
| 488 | + pass_cache = self._variable_injector.get_variable_cache() |
| 489 | + short_name = self._variable_injector.get_folder_short_name(location) |
483 | 490 | if model_constants.SECURITY_CONFIGURATION_PASSWORD in result:
|
484 | 491 | # default is false
|
485 |
| - if model_constants.SECURITY_CONFIGURATION_CD_ENABLED in result and \ |
486 |
| - Boolean.valueOf(result[model_constants.SECURITY_CONFIGURATION_CD_ENABLED]) == Boolean.TRUE: |
487 |
| - _logger.finer('WLSDPLY-06615', class_name=_class_name, method_name=_method_name) |
488 |
| - else: |
| 492 | + if model_constants.SECURITY_CONFIGURATION_CD_ENABLED not in result or \ |
| 493 | + Boolean.valueOf(result[model_constants.SECURITY_CONFIGURATION_CD_ENABLED]) == Boolean.FALSE: |
| 494 | + # Hard code it here or hard code it later. The target code will bypass tokenize of variable |
| 495 | + cache_name = short_name + VARIABLE_SEP + model_constants.SECURITY_CONFIGURATION_PASSWORD |
| 496 | + if cache_name in pass_cache: |
| 497 | + del pass_cache[cache_name] |
489 | 498 | del result[model_constants.SECURITY_CONFIGURATION_PASSWORD]
|
490 | 499 | _logger.fine('WLSDPLY-06616', class_name=_class_name, method_name=_method_name)
|
| 500 | + else: |
| 501 | + _logger.finer('WLSDPLY-06615', class_name=_class_name, method_name=_method_name) |
491 | 502 | # Determine if the SecurityConfiguration/NodeManagerEncryptedPassword can be removed
|
492 | 503 | if model_constants.SECURITY_CONFIGURATION_NM_PASSWORD in result:
|
493 | 504 | if model_constants.MACHINE in self._dictionary or model_constants.UNIX_MACHINE in self._dictionary:
|
494 | 505 | _logger.finer('WLSDPLY-06645', class_name=_class_name, method_name=_method_name)
|
495 | 506 | else:
|
| 507 | + cache_name = short_name + VARIABLE_SEP + model_constants.SECURITY_CONFIGURATION_NM_PASSWORD |
| 508 | + if cache_name in pass_cache: |
| 509 | + del pass_cache[cache_name] |
496 | 510 | del result[model_constants.SECURITY_CONFIGURATION_NM_PASSWORD]
|
497 | 511 | _logger.finer('WLSDPLY-06646', class_name=_class_name, method_name=_method_name)
|
498 | 512 |
|
|
0 commit comments