Skip to content

Commit f209654

Browse files
fixes for found issues
1 parent c328cd1 commit f209654

File tree

4 files changed

+63
-22
lines changed

4 files changed

+63
-22
lines changed

core/src/main/java/oracle/weblogic/deploy/util/XPathUtil.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ public String getPSU() {
6161
Document doc = readXmlFile(patch_file);
6262
String descrip = description(doc, "//@description");
6363
LOGGER.info("Description {0}", descrip);
64-
int idx = descrip.lastIndexOf('.');
65-
String psu = descrip.substring(idx+1);
66-
LOGGER.info("PSU Is {0}", psu);
67-
list.add(psu);
64+
if (descrip.startsWith("WLS PATCH SET UPDATE")) {
65+
int idx = descrip.lastIndexOf('.');
66+
String psu = descrip.substring(idx+1);
67+
LOGGER.info("PSU Is {0}", psu);
68+
list.add(psu);
69+
Collections.sort(list);
70+
return list.get(list.size() -1);
71+
}
6872
}
69-
Collections.sort(list);
70-
return list.get(list.size() -1);
73+
return null;
7174
}
7275

7376
/**

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,18 @@ def __init__(self, model_context, wlst_mode=WlstModes.OFFLINE, wls_version=None,
6666
:param model_context: used for tokenizing and encryption
6767
:param wlst_mode: offline or online, default is offline
6868
:param wls_version: the WLS version to use, default is to Oracle Home version
69-
:param exception_type: the exception type to be thrown
69+
:param exception_type: the exception type to be thrownN
7070
"""
7171
self._model_context = model_context
7272
self._wlst_mode = wlst_mode
7373
self._exception_type = exception_type
7474
self._logger = PlatformLogger('wlsdeploy.aliases')
7575

76-
self._wls_version = self._model_context.get_target_wls_version()
76+
if wls_version is None:
77+
self._wls_version = self._model_context.get_target_wls_version()
78+
else:
79+
self._wls_version = wls_version
80+
7781
self._alias_entries = AliasEntries(wlst_mode, self._wls_version)
7882
return
7983

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/SecurityConfiguration.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,9 +1418,10 @@
14181418
"RealmBootStrapVersion": [ {"version": "[10,12.2.1)", "wlst_mode": "offline", "wlst_name": "RealmBootStrapVersion", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "get_method": "GET", "restart_required": "true" } ,
14191419
{"version": "[10,)", "wlst_mode": "online", "wlst_name": "RealmBootStrapVersion", "wlst_path": "WP001", "value": {"default": "1" }, "wlst_type": "string", "get_method": "GET", "restart_required": "true" } ],
14201420
"RemoteAnonymousJndiEnabled": [ {"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "RemoteAnonymous${Jndi:JNDI}Enabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean", "restart_required": "true" } ],
1421-
"RemoteAnonymousRmiiiopEnabled": [ {"version": "[12.2.1.4.0.2000,12.2.1.5)", "wlst_mode": "both", "wlst_name": "RemoteAnonymous${Rmiiiop:RMIIIOP}Enabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" },
1422-
{"version": "[14.1.1,)", "wlst_mode": "both", "wlst_name": "RemoteAnonymous${Rmiiiop:RMIIIOP}Enabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],
1423-
"RemoteAnonymousRmit3Enabled": [ {"version": "[14.1.1,)", "wlst_mode": "both", "wlst_name": "RemoteAnonymous${Rmit3:RMIT3}Enabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],
1421+
"RemoteAnonymousRmiiiopEnabled": [ {"version": "[12.2.1.4.0.210930,12.2.1.5)", "wlst_mode": "both", "wlst_name": "RemoteAnonymous${Rmiiiop:RMIIIOP}Enabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" },
1422+
{"version": "[14.1.1,)", "wlst_mode": "both", "wlst_name": "RemoteAnonymous${Rmiiiop:RMIIIOP}Enabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],
1423+
"RemoteAnonymousRmit3Enabled": [ {"version": "[12.2.1.4.0.210930,12.2.1.5)", "wlst_mode": "both", "wlst_name": "RemoteAnonymous${Rmit3:RMIT3}Enabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ,
1424+
{"version": "[14.1.1,)", "wlst_mode": "both", "wlst_name": "RemoteAnonymous${Rmit3:RMIT3}Enabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],
14241425
"UseKSSForDemo": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "UseKSSForDemo", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean", "restart_required": "true" } ],
14251426
"WebAppFilesCaseInsensitive": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "WebAppFilesCaseInsensitive", "wlst_path": "WP001", "value": {"default": "${None:false}"}, "wlst_type": "string", "restart_required": "true" } ]
14261427
},

core/src/test/python/aliases_test.py

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,13 @@ def testGetWlstAttributeName2(self):
407407

408408
def testIsWlstModelAttributeName(self):
409409
wls_version = '10.3.6'
410-
online_aliases = Aliases(self.model_context, WlstModes.ONLINE, wls_version)
410+
arg_map = {
411+
CommandLineArgUtil.ORACLE_HOME_SWITCH: '/oracleHome',
412+
CommandLineArgUtil.DOMAIN_HOME_SWITCH: '',
413+
CommandLineArgUtil.TARGET_VERSION_SWITCH: '10.3.6'
414+
}
415+
online_model_context = ModelContext("test", arg_map)
416+
online_aliases = Aliases(online_model_context, WlstModes.ONLINE, wls_version)
411417
location = get_jdbc_driver_params_location('my-datasource', self.aliases)
412418
model_attribute_name = 'QosDegradationAllowed'
413419
path = self.aliases.get_model_folder_path(location)
@@ -441,11 +447,11 @@ def testIsWlstModelAttributeName(self):
441447
return
442448

443449
def testIsPSUMatch(self):
444-
wls_version = '12.2.1.4.2001'
450+
wls_version = '12.2.1.4.0.210930'
445451
arg_map = {
446452
CommandLineArgUtil.ORACLE_HOME_SWITCH: '/oracleHome',
447453
CommandLineArgUtil.DOMAIN_HOME_SWITCH: '',
448-
CommandLineArgUtil.TARGET_VERSION_SWITCH: '12.2.1.4.2001'
454+
CommandLineArgUtil.TARGET_VERSION_SWITCH: '12.2.1.4.0.210930'
449455
}
450456

451457
this_model_context = ModelContext("test", arg_map)
@@ -543,9 +549,20 @@ def testNewGetWlstPaths(self):
543549
def testVersionFilteredFolders(self):
544550
old_wls_version = '10.3.6'
545551
new_wls_version = '12.2.1.3'
546-
547-
old_aliases = Aliases(self.model_context, WlstModes.OFFLINE, old_wls_version)
548-
new_aliases = Aliases(self.model_context, WlstModes.OFFLINE, new_wls_version)
552+
arg_map = {
553+
CommandLineArgUtil.ORACLE_HOME_SWITCH: '/oracleHome',
554+
CommandLineArgUtil.DOMAIN_HOME_SWITCH: '',
555+
CommandLineArgUtil.TARGET_VERSION_SWITCH: '10.3.6'
556+
}
557+
old_model_context = ModelContext("test", arg_map)
558+
old_aliases = Aliases(old_model_context, WlstModes.OFFLINE, old_wls_version)
559+
arg_map = {
560+
CommandLineArgUtil.ORACLE_HOME_SWITCH: '/oracleHome',
561+
CommandLineArgUtil.DOMAIN_HOME_SWITCH: '',
562+
CommandLineArgUtil.TARGET_VERSION_SWITCH: '12.2.1.3'
563+
}
564+
new_model_context = ModelContext("test", arg_map)
565+
new_aliases = Aliases(new_model_context, WlstModes.OFFLINE, new_wls_version)
549566
location = LocationContext()
550567
location.append_location(FOLDERS.PARTITION)
551568
mbean_type = old_aliases.get_wlst_mbean_type(location)
@@ -565,9 +582,20 @@ def testVersionFilteredFolders(self):
565582
def testVersionFilteredFoldersWithFolderParams(self):
566583
old_wls_version = '10.3.6'
567584
new_wls_version = '12.2.1.3'
568-
569-
old_aliases = Aliases(self.model_context, WlstModes.OFFLINE, old_wls_version)
570-
new_aliases = Aliases(self.model_context, WlstModes.OFFLINE, new_wls_version)
585+
arg_map = {
586+
CommandLineArgUtil.ORACLE_HOME_SWITCH: '/oracleHome',
587+
CommandLineArgUtil.DOMAIN_HOME_SWITCH: '',
588+
CommandLineArgUtil.TARGET_VERSION_SWITCH: '10.3.6'
589+
}
590+
old_model_context = ModelContext("test", arg_map)
591+
old_aliases = Aliases(old_model_context, WlstModes.OFFLINE, old_wls_version)
592+
arg_map = {
593+
CommandLineArgUtil.ORACLE_HOME_SWITCH: '/oracleHome',
594+
CommandLineArgUtil.DOMAIN_HOME_SWITCH: '',
595+
CommandLineArgUtil.TARGET_VERSION_SWITCH: '12.2.1.3'
596+
}
597+
new_model_context = ModelContext("test", arg_map)
598+
new_aliases = Aliases(new_model_context, WlstModes.OFFLINE, new_wls_version)
571599
location = LocationContext()
572600
location.append_location(FOLDERS.SAF_AGENT)
573601
name_token = old_aliases.get_name_token(location)
@@ -814,8 +842,13 @@ def testIsValidModelFolderName(self):
814842
location = LocationContext()
815843
result, message = self.aliases.is_valid_model_folder_name(location, 'ServerTemplate')
816844
self.assertEqual(result, ValidationCodes.VALID)
817-
818-
aliases = Aliases(self.model_context, wls_version='12.1.1')
845+
arg_map = {
846+
CommandLineArgUtil.ORACLE_HOME_SWITCH: '/oracleHome',
847+
CommandLineArgUtil.DOMAIN_HOME_SWITCH: '',
848+
CommandLineArgUtil.TARGET_VERSION_SWITCH: '12.1.1'
849+
}
850+
this_model_context = ModelContext("test", arg_map)
851+
aliases = Aliases(this_model_context, wls_version='12.1.1')
819852
result, message = aliases.is_valid_model_folder_name(location, 'ServerTemplate')
820853
self.assertEqual(result, ValidationCodes.VERSION_INVALID)
821854

0 commit comments

Comments
 (0)