Skip to content

Commit c3fb530

Browse files
committed
Correct calculated listen ports setting in wko_filter
1 parent 96b7886 commit c3fb530

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
AUDITOR = 'Auditor'
4242
AUTHENTICATION_PROVIDER = 'AuthenticationProvider'
4343
AUTHORIZER = 'Authorizer'
44+
CALCULATED_LISTEN_PORTS = 'CalculatedListenPorts'
4445
CAPACITY = 'Capacity'
4546
CDI_CONTAINER = 'CdiContainer'
4647
CERT_PATH_PROVIDER = 'CertPathProvider'

core/src/main/python/wlsdeploy/tool/util/filters/wko_filter.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@
66
# ------------
77
# WDT filters to prepare a model for use with WKO, using the createDomain or prepareModel tools.
88
# These operations can be invoked as a single call, or independently of each other.
9+
10+
from wlsdeploy.aliases import alias_utils
11+
from wlsdeploy.aliases.model_constants import CALCULATED_LISTEN_PORTS
12+
from wlsdeploy.aliases.model_constants import CLUSTER
13+
from wlsdeploy.aliases.model_constants import DYNAMIC_SERVERS
14+
from wlsdeploy.aliases.model_constants import TOPOLOGY
915
from wlsdeploy.aliases.validation_codes import ValidationCodes
1016
from wlsdeploy.aliases.wlst_modes import WlstModes
1117
from wlsdeploy.exception.expection_types import ExceptionType
18+
from wlsdeploy.logging.platform_logger import PlatformLogger
1219
from wlsdeploy.tool.util.filters.model_traverse import ModelTraverse
20+
from wlsdeploy.util import dictionary_utils
21+
22+
_class_name = 'wko_filter'
23+
_logger = PlatformLogger('wlsdeploy.aliases')
1324

1425

1526
def filter_model(model, model_context):
@@ -41,14 +52,27 @@ def check_clustered_server_ports(model, model_context):
4152
:param model: the model to be filtered
4253
:param model_context: unused, passed by filter_helper if called independently
4354
"""
44-
print("CHECK_CLUSTERED SERVER PORTS")
55+
_method_name = 'check_clustered_server_ports'
56+
57+
topology_folder = dictionary_utils.get_dictionary_element(model, TOPOLOGY)
58+
59+
# be sure every dynamic cluster has DynamicServers/CalculatedListenPorts set to false
60+
61+
clusters_folder = dictionary_utils.get_dictionary_element(topology_folder, CLUSTER)
62+
for cluster_name, cluster_fields in clusters_folder.items():
63+
dynamic_folder = cluster_fields[DYNAMIC_SERVERS]
64+
if dynamic_folder:
65+
calculated_listen_ports = dynamic_folder[CALCULATED_LISTEN_PORTS]
66+
if (calculated_listen_ports is None) or alias_utils.convert_boolean(calculated_listen_ports):
67+
_logger.info('WLSDPLY-20036', CALCULATED_LISTEN_PORTS, cluster_name, class_name=_class_name,
68+
method_name=_method_name)
69+
dynamic_folder[CALCULATED_LISTEN_PORTS] = False
4570

4671

4772
class OnlineAttributeFilter(ModelTraverse):
4873
"""
4974
Traverse the model and remove any online-only attributes.
5075
"""
51-
_class_name = 'OnlineAttributeFilter'
5276

5377
def __init__(self, model_context, exception_type):
5478
# use OFFLINE regardless of tool configuration
@@ -65,5 +89,5 @@ def unrecognized_field(self, model_dict, key, model_location):
6589
result, message = self._aliases.is_valid_model_attribute_name(model_location, key)
6690
if result == ValidationCodes.VERSION_INVALID:
6791
path = self._aliases.get_model_folder_path(model_location)
68-
self._logger.info('WLSDPLY-20033', key, path, class_name=self._class_name, method_name=_method_name)
92+
_logger.info('WLSDPLY-20033', key, path, class_name=_class_name, method_name=_method_name)
6993
del model_dict[key]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,7 @@ WLSDPLY-20032=No model specified and no model in archive, no validation performe
16361636
WLSDPLY-20033=Unsupported attribute {0} at location {1} removed from model
16371637
WLSDPLY-20034=Applying filter with ID "{0}"
16381638
WLSDPLY-20035=Applying filter with name "{0}"
1639+
WLSDPLY-20036=Changing {0} to false for cluster "{1}"
16391640

16401641
# Common messages used for tool exit and clean-up
16411642
WLSDPLY-21000={0} Messages:

0 commit comments

Comments
 (0)