|
15 | 15 | from java.lang import System
|
16 | 16 | from java.util import HashSet
|
17 | 17 | from oracle.weblogic.deploy.aliases import AliasException
|
| 18 | +from oracle.weblogic.deploy.aliases import VersionUtils |
18 | 19 | from oracle.weblogic.deploy.discover import DiscoverException
|
| 20 | +from oracle.weblogic.deploy.exception import ExceptionHelper |
19 | 21 | from oracle.weblogic.deploy.json import JsonException
|
20 | 22 | from oracle.weblogic.deploy.util import FileUtils
|
21 | 23 | from oracle.weblogic.deploy.util import PyOrderedDict
|
@@ -790,6 +792,23 @@ def __check_and_customize_model(model, model_context, aliases, credential_inject
|
790 | 792 | __logger.exiting(_class_name, _method_name)
|
791 | 793 | return model
|
792 | 794 |
|
| 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 | + |
793 | 812 | def __fix_discovered_template_datasource(model, model_context):
|
794 | 813 | # fix the case for discovering template datasources.
|
795 | 814 | # If all the template datasources use the dame passwords then generate the RUCDbInfo section
|
@@ -1037,6 +1056,8 @@ def main(model_context):
|
1037 | 1056 | password_key = 'WLSDPLY-06024'
|
1038 | 1057 | __logger.info(password_key, class_name=_class_name, method_name=_method_name)
|
1039 | 1058 |
|
| 1059 | + __compare_wls_versions(model_context) |
| 1060 | + |
1040 | 1061 | extra_tokens = {}
|
1041 | 1062 | try:
|
1042 | 1063 | model = __discover(model_context, aliases, credential_injector, helper, extra_tokens)
|
|
0 commit comments