Skip to content

Commit 8fa93b2

Browse files
committed
Merge branch 'jira-wdt-929-attribute-messages' into 'main'
Reduce visibility of messages for unrecognized attributes See merge request weblogic-cloud/weblogic-deploy-tooling!1785
2 parents 23e5a7d + f890c53 commit 8fa93b2

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

core/src/main/python/discover.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
from java.lang import System
1616
from java.util import HashSet
1717
from oracle.weblogic.deploy.aliases import AliasException
18+
from oracle.weblogic.deploy.aliases import VersionUtils
1819
from oracle.weblogic.deploy.discover import DiscoverException
20+
from oracle.weblogic.deploy.exception import ExceptionHelper
1921
from oracle.weblogic.deploy.json import JsonException
2022
from oracle.weblogic.deploy.util import FileUtils
2123
from oracle.weblogic.deploy.util import PyOrderedDict
@@ -790,6 +792,23 @@ def __check_and_customize_model(model, model_context, aliases, credential_inject
790792
__logger.exiting(_class_name, _method_name)
791793
return model
792794

795+
def __compare_wls_versions(model_context):
796+
"""
797+
Compare the local and remote WLS versions, and log a notification if they are different.
798+
No message will be logged for offline discovery, because there is no remote version.
799+
"""
800+
_method_name = '__compare_wls_versions'
801+
local_wls_version = model_context.get_local_wls_version()
802+
remote_wls_version = model_context.get_remote_wls_version()
803+
if remote_wls_version and local_wls_version != remote_wls_version:
804+
if VersionUtils.compareVersions(local_wls_version, remote_wls_version) > 0:
805+
message_key = 'WLSDPLY-06066'
806+
else:
807+
message_key = 'WLSDPLY-06067'
808+
message_start = ExceptionHelper.getMessage(message_key, [local_wls_version, remote_wls_version])
809+
__logger.notification(
810+
'WLSDPLY-06068', message_start, class_name=_class_name, method_name=_method_name)
811+
793812
def __fix_discovered_template_datasource(model, model_context):
794813
# fix the case for discovering template datasources.
795814
# If all the template datasources use the dame passwords then generate the RUCDbInfo section
@@ -1037,6 +1056,8 @@ def main(model_context):
10371056
password_key = 'WLSDPLY-06024'
10381057
__logger.info(password_key, class_name=_class_name, method_name=_method_name)
10391058

1059+
__compare_wls_versions(model_context)
1060+
10401061
extra_tokens = {}
10411062
try:
10421063
model = __discover(model_context, aliases, credential_injector, helper, extra_tokens)

core/src/main/python/wlsdeploy/tool/discover/discoverer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ def _get_model_name_and_value(self, location, wlst_name, wlst_value, wlst_path):
328328
_logger.fine('WLSDPLY-06166', wlst_name, wlst_path,
329329
class_name=_class_name, method_name=_method_name)
330330
else:
331-
_logger.info('WLSDPLY-06106', wlst_name, wlst_path, de.getLocalizedMessage(),
331+
# reduced this from info to fine to avoid excess output with WLS PSU mismatch
332+
_logger.fine('WLSDPLY-06106', wlst_name, wlst_path, de.getLocalizedMessage(),
332333
class_name=_class_name, method_name=_method_name)
333334

334335
return model_name, model_value

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,9 @@ WLSDPLY-06062=Failed to read OPSS wallet passphrase: {0}
822822
WLSDPLY-06063=User failed to provide the required OPSS wallet passphrase
823823
WLSDPLY-06064={0} invoked with {1} argument but that argument is only valid in online mode.
824824
WLSDPLY-06065={0} invoked with both {1} and {2} arguments, which are mutually exclusive.
825+
WLSDPLY-06066=Local WebLogic version {0} is more recent than remote version {1}.
826+
WLSDPLY-06067=Local WebLogic version {0} is older than remote version {1}.
827+
WLSDPLY-06068={0} This may cause some attributes to be omitted from the discovered model.
825828

826829
# discoverer.py
827830
WLSDPLY-06100=Find attributes at location {0}

0 commit comments

Comments
 (0)