Skip to content

Commit a0074da

Browse files
fix merge conflict
2 parents e804d92 + 7d00621 commit a0074da

File tree

235 files changed

+11249
-6444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+11249
-6444
lines changed

alias-test/pom.xml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
4-
The Universal Permissive License (UPL), Version 1.0
3+
Copyright (c) 2020, 2022, Oracle and/or its affiliates.
4+
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
-->
66
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
77
<modelVersion>4.0.0</modelVersion>
@@ -21,19 +21,8 @@
2121

2222
<dependencies>
2323
<dependency>
24-
<groupId>junit</groupId>
25-
<artifactId>junit</artifactId>
26-
<version>4.13.1</version>
27-
<scope>test</scope>
28-
</dependency>
29-
<dependency>
30-
<groupId>com.google.guava</groupId>
31-
<artifactId>guava</artifactId>
32-
<scope>test</scope>
33-
</dependency>
34-
<dependency>
35-
<groupId>commons-io</groupId>
36-
<artifactId>commons-io</artifactId>
24+
<groupId>org.junit.jupiter</groupId>
25+
<artifactId>junit-jupiter-engine</artifactId>
3726
<scope>test</scope>
3827
</dependency>
3928
</dependencies>

alias-test/src/test/python/aliastest/verify/verifier_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2020, 2021, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2020, 2022, Oracle Corporation and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates.
4-
The Universal Permissive License (UPL), Version 1.0
4+
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
55
-->
66
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
77
<modelVersion>4.0.0</modelVersion>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
55
These constants are internal to the aliases module and should not be used, as they are not part of the public API.
@@ -10,8 +10,8 @@
1010
ATTRIBUTES = 'attributes'
1111
CHILD_FOLDERS_TYPE = 'child_folders_type'
1212
CONTAINS = 'contains'
13-
DEFAULT = 'default'
1413
DEFAULT_NAME_VALUE = 'default_name_value'
14+
DEFAULT_VALUE = 'default_value'
1515
FLATTENED_FOLDER_DATA = 'flattened_folder_data'
1616
FOLDERS = 'folders'
1717
FOLDER_ORDER = 'folder_order'
@@ -31,7 +31,6 @@
3131
UNRESOLVED_ATTRIBUTES_MAP = '__unresolved_attributes__'
3232
UNRESOLVED_FOLDERS_MAP = '__unresolved_folders__'
3333
USES_PATH_TOKENS = 'uses_path_tokens'
34-
VALUE = 'value'
3534
# VERSION is used for folder versioning
3635
VERSION = 'version'
3736
# VERSION_RAGE is used for attribute versioning
@@ -70,6 +69,9 @@
7069
ROD = 'ROD' # Read only but discover
7170
RW = 'RW' # Default Read WRITE
7271

72+
# used when DEFAULT_VALUE has curly-brace value that resolves to null
73+
NULL_VALUE_KEY = '__NULL__'
74+
7375
# attribute wlst_type values
7476
BOOLEAN = 'boolean'
7577
COMMA_DELIMITED_STRING = 'delimited_string[comma]'

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2021, Oracle Corporation and/or its affiliates.
2+
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import copy
@@ -17,6 +17,7 @@
1717
from wlsdeploy.aliases.alias_constants import ChildFoldersTypes
1818
from wlsdeploy.aliases.alias_constants import CONTAINS
1919
from wlsdeploy.aliases.alias_constants import DEFAULT_NAME_VALUE
20+
from wlsdeploy.aliases.alias_constants import DEFAULT_VALUE
2021
from wlsdeploy.aliases.alias_constants import FLATTENED_FOLDER_DATA
2122
from wlsdeploy.aliases.alias_constants import FOLDER_ORDER
2223
from wlsdeploy.aliases.alias_constants import FOLDER_PARAMS
@@ -26,6 +27,7 @@
2627
from wlsdeploy.aliases.alias_constants import MODEL_NAME
2728
from wlsdeploy.aliases.alias_constants import NAME_VALUE
2829
from wlsdeploy.aliases.alias_constants import NONE_CHILD_FOLDERS_TYPE
30+
from wlsdeploy.aliases.alias_constants import NULL_VALUE_KEY
2931
from wlsdeploy.aliases.alias_constants import PATH_TOKEN
3032
from wlsdeploy.aliases.alias_constants import SET_MBEAN_TYPE
3133
from wlsdeploy.aliases.alias_constants import SET_METHOD
@@ -891,7 +893,7 @@ def is_model_location_valid(self, location):
891893
def get_folders_in_order_for_location(self, location):
892894
"""
893895
Find the folders that are ordered (greater than zero) at the specified location and
894-
return the list in order of the
896+
return the list in ascending order
895897
:param location:
896898
:return:
897899
"""
@@ -1468,6 +1470,9 @@ def __resolve_attribute(self, attr_dict):
14681470
result[key] = self.__resolve_attribute(attr)
14691471
else:
14701472
result[key] = self._resolve_curly_braces(attr)
1473+
# resolve null key in curly brace values, such as "${__NULL__,Online}"
1474+
if key == DEFAULT_VALUE and result[key] == NULL_VALUE_KEY:
1475+
result[key] = None
14711476

14721477
for key in [GET_METHOD, SET_METHOD, GET_MBEAN_TYPE, SET_MBEAN_TYPE]:
14731478
if key in result and len(result[key]) == 0:

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from wlsdeploy.aliases.alias_constants import ALIAS_MAP_TYPES
1717
from wlsdeploy.aliases.alias_constants import ATTRIBUTES
1818
from wlsdeploy.aliases.alias_constants import ChildFoldersTypes
19-
from wlsdeploy.aliases.alias_constants import DEFAULT
19+
from wlsdeploy.aliases.alias_constants import DEFAULT_VALUE
2020
from wlsdeploy.aliases.alias_constants import FLATTENED_FOLDER_DATA
2121
from wlsdeploy.aliases.alias_constants import FOLDERS
2222
from wlsdeploy.aliases.alias_constants import GET
@@ -38,7 +38,6 @@
3838
from wlsdeploy.aliases.alias_constants import SET_METHOD
3939
from wlsdeploy.aliases.alias_constants import STRING
4040
from wlsdeploy.aliases.alias_constants import USES_PATH_TOKENS
41-
from wlsdeploy.aliases.alias_constants import VALUE
4241
from wlsdeploy.aliases.alias_constants import WLST_NAME
4342
from wlsdeploy.aliases.alias_constants import WLST_READ_TYPE
4443
from wlsdeploy.aliases.alias_constants import WLST_TYPE
@@ -512,7 +511,7 @@ def get_wlst_attribute_name_and_value(self, location, model_attribute_name, mode
512511
model_val = alias_utils.convert_to_type(LIST, model_attribute_value,
513512
delimiter=MODEL_LIST_DELIMITER)
514513

515-
if uses_path_tokens:
514+
if uses_path_tokens and model_val is not None:
516515
for index, item in enumerate(model_val):
517516
item_value = self._model_context.replace_token_string(str(item))
518517
model_val[index] = item_value
@@ -990,20 +989,21 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
990989
delimiter=delimiter)
991990

992991
model_attribute_name = attribute_info[MODEL_NAME]
993-
default_value = attribute_info[VALUE][DEFAULT]
992+
default_value = attribute_info[DEFAULT_VALUE]
994993

995994
#
996995
# The logic below to compare the str() representation of the converted value and the default value
997996
# only works for lists/maps if both the converted value and the default value are the same data type...
998997
#
999998
if (model_type in ALIAS_LIST_TYPES or model_type in ALIAS_MAP_TYPES) \
1000-
and not (default_value == '[]' or default_value == 'None'):
999+
and not (default_value == '[]' or default_value is None):
10011000
# always the model delimiter
10021001
default_value = alias_utils.convert_to_type(model_type, default_value,
10031002
delimiter=MODEL_LIST_DELIMITER)
10041003

10051004
if attribute_info[WLST_TYPE] == STRING:
1006-
default_value = alias_utils.replace_tokens_in_path(location, default_value)
1005+
if default_value:
1006+
default_value = alias_utils.replace_tokens_in_path(location, default_value)
10071007

10081008
if model_type == 'password':
10091009
if string_utils.is_empty(wlst_attribute_value) or converted_value == default_value:
@@ -1021,7 +1021,7 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
10211021

10221022
elif (model_type in ALIAS_LIST_TYPES or data_type in ALIAS_MAP_TYPES) and \
10231023
(converted_value is None or len(converted_value) == 0):
1024-
if default_value == '[]' or default_value == 'None':
1024+
if default_value == '[]' or default_value is None:
10251025
model_attribute_value = None
10261026

10271027
elif self._model_context is not None and USES_PATH_TOKENS in attribute_info:
@@ -1031,6 +1031,10 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
10311031
model_attribute_value = self._model_context.tokenize_classpath(converted_value)
10321032
if model_attribute_value == default_value:
10331033
model_attribute_value = None
1034+
1035+
elif default_value is None:
1036+
model_attribute_value = converted_value
1037+
10341038
elif str(converted_value) != str(default_value):
10351039
if _strings_are_empty(converted_value, default_value):
10361040
model_attribute_value = None
@@ -1199,15 +1203,12 @@ def get_model_attribute_default_value(self, location, model_attribute_name):
11991203
default_value = None
12001204
attribute_info = self._alias_entries.get_alias_attribute_entry_by_model_name(location, model_attribute_name)
12011205
if attribute_info is not None:
1202-
default_value = attribute_info[VALUE][DEFAULT]
1203-
if default_value == 'None':
1204-
default_value = None
1205-
else:
1206-
data_type, delimiter = \
1207-
alias_utils.compute_read_data_type_and_delimiter_from_attribute_info(
1208-
attribute_info, default_value)
1206+
default_value = attribute_info[DEFAULT_VALUE]
1207+
data_type, delimiter = \
1208+
alias_utils.compute_read_data_type_and_delimiter_from_attribute_info(
1209+
attribute_info, default_value)
12091210

1210-
default_value = alias_utils.convert_to_type(data_type, default_value, delimiter=delimiter)
1211+
default_value = alias_utils.convert_to_type(data_type, default_value, delimiter=delimiter)
12111212
self._logger.exiting(class_name=self._class_name, method_name=_method_name, result=default_value)
12121213
return default_value
12131214
except AliasException, ae:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@
298298
UNIX_MACHINE_ATTRIBUTE = 'PostBindGID'
299299
UPDATE_MODE = 'UpdateMode'
300300
USER = 'User'
301+
USER_ATTRIBUTES = 'UserAttribute'
302+
VIRTUAL_HOST = 'VirtualHost'
301303
VIRTUAL_TARGET = 'VirtualTarget'
302304
VIRTUAL_USER_AUTHENTICATOR = 'VirtualUserAuthenticator'
303305
WATCH = 'Watch'

core/src/main/python/wlsdeploy/tool/create/atp_helper.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
"""
2-
Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. All rights reserved.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
55
66
"""
77
import re
88
from xml.dom.minidom import parse
9+
from wlsdeploy.exception import exception_helper
910

11+
from wlsdeploy.logging.platform_logger import PlatformLogger
12+
13+
_logger = PlatformLogger('wlsdeploy.create')
1014

1115
def set_ssl_properties(xmlDoc, atp_creds_path, keystore_password, truststore_password):
1216
'''
@@ -63,7 +67,6 @@ def fix_jps_config(rcu_db_info, model_context):
6367

6468

6569
def get_atp_connect_string(tnsnames_ora_path, tns_sid_name):
66-
6770
try:
6871
f = open(tnsnames_ora_path, "r+")
6972
try:
@@ -76,17 +79,24 @@ def get_atp_connect_string(tnsnames_ora_path, tns_sid_name):
7679
pattern = tns_sid_name + '\s*=\s*([(].*\n.*)'
7780
match = re.search(pattern, text)
7881
if match:
79-
str = match.group(1)
80-
tnsConnectString=str.replace('\r','').replace('\n','')
81-
str = format_connect_string(tnsConnectString)
82-
return str
83-
except:
84-
pass
85-
86-
return None
87-
88-
89-
def format_connect_string(connect_string):
82+
connect_string = match.group(1)
83+
tnsConnectString = connect_string.replace('\r','').replace('\n','')
84+
connect_string = cleanup_connect_string(tnsConnectString)
85+
return connect_string, None
86+
else:
87+
ex = exception_helper.create_create_exception("WLSDPLY-12563", tns_sid_name)
88+
_logger.throwing(ex, class_name='atp_helper', method_name='get_atp_connect_string')
89+
raise ex
90+
except IOError, ioe:
91+
ex = exception_helper.create_create_exception("WLSDPLY-12570", str(ioe))
92+
_logger.throwing(ex, class_name='atp_helper', method_name='get_atp_connect_string')
93+
raise ex
94+
except Exception, ex:
95+
ex = exception_helper.create_create_exception("WLSDPLY-12570", str(ex))
96+
_logger.throwing(ex, class_name='atp_helper', method_name='get_atp_connect_string')
97+
raise ex
98+
99+
def cleanup_connect_string(connect_string):
90100
"""
91101
Formats connect string for ATP DB by removing unwanted whitespaces.
92102
Input:
@@ -109,5 +119,5 @@ def format_connect_string(connect_string):
109119
part3 = match.group(3)
110120
part4 = match.group(4).replace(' ', '')
111121
connect_string = "%s%s%s%s" % (part1, part2, part3, part4)
112-
122+
# if no match then return original one
113123
return connect_string

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2022, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import os
@@ -70,7 +70,6 @@
7070
from wlsdeploy.aliases.model_constants import USER
7171
from wlsdeploy.aliases.model_constants import VIRTUAL_TARGET
7272
from wlsdeploy.aliases.model_constants import WLS_USER_PASSWORD_CREDENTIAL_MAPPINGS
73-
from wlsdeploy.aliases.model_constants import WLS_DEFAULT_AUTHENTICATION
7473
from wlsdeploy.aliases.model_constants import WS_RELIABLE_DELIVERY_POLICY
7574
from wlsdeploy.aliases.model_constants import WEB_SERVICE_SECURITY
7675
from wlsdeploy.aliases.model_constants import XML_ENTITY_CACHE
@@ -91,6 +90,7 @@
9190
from wlsdeploy.tool.util.rcu_helper import RCUHelper
9291
from wlsdeploy.tool.util.target_helper import TargetHelper
9392
from wlsdeploy.tool.util.targeting_types import TargetingType
93+
from wlsdeploy.tool.util.topology_profiles import TopologyProfile
9494
from wlsdeploy.tool.util.topology_helper import TopologyHelper
9595
from wlsdeploy.util import dictionary_utils
9696
from wlsdeploy.util import model
@@ -509,6 +509,12 @@ def __create_base_domain_with_select_template(self, domain_home):
509509
_method_name = '__create_base_domain_with_select_template'
510510

511511
self.logger.entering(domain_home, class_name=self.__class_name, method_name=_method_name)
512+
513+
topology_profile = self._domain_typedef.get_topology_profile()
514+
if topology_profile in TopologyProfile:
515+
self.logger.info('WLSDPLY-12569', topology_profile, class_name=self.__class_name, method_name=_method_name)
516+
self.wlst_helper.set_topology_profile(topology_profile)
517+
512518
base_template = self._domain_typedef.get_base_template()
513519
self.logger.info('WLSDPLY-12210', base_template,
514520
class_name=self.__class_name, method_name=_method_name)
@@ -634,8 +640,9 @@ def __apply_base_domain_config(self, topology_folder_list):
634640
self.__create_reliable_delivery_policy(location)
635641
topology_folder_list.remove(WS_RELIABLE_DELIVERY_POLICY)
636642

637-
# these deletions were intentionally skipped when these elements are first created.
638-
self.topology_helper.remove_deleted_clusters_and_servers(location, self._topology)
643+
# this second pass will re-establish any attributes that were changed by templates,
644+
# and process deletes and re-adds of named elements in the model order.
645+
self.__create_machines_clusters_and_servers()
639646
topology_folder_list.remove(MACHINE)
640647
topology_folder_list.remove(UNIX_MACHINE)
641648
topology_folder_list.remove(CLUSTER)
@@ -961,14 +968,9 @@ def __retrieve_atp_rcudbinfo(self, rcu_db_info, checkAdminPwd=False):
961968
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
962969
raise ex
963970

964-
rcu_database = atp_helper.get_atp_connect_string(tns_admin + os.sep + 'tnsnames.ora',
971+
rcu_database, error = atp_helper.get_atp_connect_string(tns_admin + os.sep + 'tnsnames.ora',
965972
rcu_db_info.get_atp_entry())
966973

967-
if rcu_database is None:
968-
ex = exception_helper.create_create_exception('WLSDPLY-12563', rcu_db_info.get_atp_entry())
969-
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
970-
raise ex
971-
972974
keystore_pwd = rcu_db_info.get_keystore_password()
973975
truststore_pwd = rcu_db_info.get_truststore_password()
974976

0 commit comments

Comments
 (0)