6
6
# ------------
7
7
# WDT filters to prepare a model for use with WKO, using the createDomain or prepareModel tools.
8
8
# 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
9
15
from wlsdeploy .aliases .validation_codes import ValidationCodes
10
16
from wlsdeploy .aliases .wlst_modes import WlstModes
11
17
from wlsdeploy .exception .expection_types import ExceptionType
18
+ from wlsdeploy .logging .platform_logger import PlatformLogger
12
19
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' )
13
24
14
25
15
26
def filter_model (model , model_context ):
@@ -41,14 +52,27 @@ def check_clustered_server_ports(model, model_context):
41
52
:param model: the model to be filtered
42
53
:param model_context: unused, passed by filter_helper if called independently
43
54
"""
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
45
70
46
71
47
72
class OnlineAttributeFilter (ModelTraverse ):
48
73
"""
49
74
Traverse the model and remove any online-only attributes.
50
75
"""
51
- _class_name = 'OnlineAttributeFilter'
52
76
53
77
def __init__ (self , model_context , exception_type ):
54
78
# use OFFLINE regardless of tool configuration
@@ -65,5 +89,5 @@ def unrecognized_field(self, model_dict, key, model_location):
65
89
result , message = self ._aliases .is_valid_model_attribute_name (model_location , key )
66
90
if result == ValidationCodes .VERSION_INVALID :
67
91
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 )
69
93
del model_dict [key ]
0 commit comments