Skip to content

Commit 488f071

Browse files
committed
Merge branch 'wko-filter-addresses' into 'main'
Filter addresses in Server and Cluster for target wko4 See merge request weblogic-cloud/weblogic-deploy-tooling!1798
2 parents c4b5842 + 3487307 commit 488f071

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@
389389
AUTO_MIGRATION_ENABLED = 'AutoMigrationEnabled'
390390
CANDIDATE_MACHINE = 'CandidateMachine'
391391
CANDIDATE_MACHINES_FOR_MIGRATABLE_SERVER = 'CandidateMachinesForMigratableServer'
392+
CLUSTER_ADDRESS = 'ClusterAddress'
392393
COMPONENT_TYPE = 'ComponentType'
393394
CONSTRAINED_CANDIDATE_SERVER = 'ConstrainedCandidateServer'
394395
CUSTOM_IDENTITY_KEYSTORE_FILE = 'CustomIdentityKeyStoreFileName'
@@ -420,6 +421,7 @@
420421
HARVESTED_INSTANCE = 'HarvestedInstance'
421422
HOSTING_SERVER = 'HostingServer'
422423
INSTALL_DIR = 'InstallDir'
424+
INTERFACE_ADDRESS = 'InterfaceAddress'
423425
LISTEN_ADDRESS = 'ListenAddress'
424426
LISTEN_PORT = 'ListenPort'
425427
MASKED_PASSWORD = '<Masked>'

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

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515
from wlsdeploy.aliases.model_constants import CANDIDATE_MACHINE
1616
from wlsdeploy.aliases.model_constants import CANDIDATE_MACHINES_FOR_MIGRATABLE_SERVER
1717
from wlsdeploy.aliases.model_constants import CLUSTER
18+
from wlsdeploy.aliases.model_constants import CLUSTER_ADDRESS
1819
from wlsdeploy.aliases.model_constants import CLUSTER_MESSAGING_MODE
1920
from wlsdeploy.aliases.model_constants import DATABASE_LESS_LEASING_BASIS
2021
from wlsdeploy.aliases.model_constants import DYNAMIC_SERVERS
22+
from wlsdeploy.aliases.model_constants import INTERFACE_ADDRESS
23+
from wlsdeploy.aliases.model_constants import LISTEN_ADDRESS
2124
from wlsdeploy.aliases.model_constants import MACHINE
2225
from wlsdeploy.aliases.model_constants import MIGRATION_BASIS
26+
from wlsdeploy.aliases.model_constants import MULTICAST_ADDRESS
27+
from wlsdeploy.aliases.model_constants import NETWORK_ACCESS_POINT
2328
from wlsdeploy.aliases.model_constants import NM_PROPERTIES
2429
from wlsdeploy.aliases.model_constants import NODE_MANAGER_PW_ENCRYPTED
2530
from wlsdeploy.aliases.model_constants import NODE_MANAGER_USER_NAME
@@ -140,17 +145,27 @@ def filter_topology(model, _model_context):
140145
del topology[delete_key]
141146

142147
clusters = dictionary_utils.get_dictionary_element(topology, CLUSTER)
143-
for cluster in clusters:
148+
for key in clusters:
149+
cluster = clusters[key]
144150
for delete_key in [MIGRATION_BASIS, CANDIDATE_MACHINES_FOR_MIGRATABLE_SERVER, DATABASE_LESS_LEASING_BASIS,
145-
CLUSTER_MESSAGING_MODE]:
146-
if delete_key in clusters[cluster]:
147-
del clusters[cluster][delete_key]
151+
CLUSTER_MESSAGING_MODE, CLUSTER_ADDRESS, MULTICAST_ADDRESS]:
152+
if delete_key in cluster:
153+
del cluster[delete_key]
148154

149155
servers = dictionary_utils.get_dictionary_element(topology, SERVER)
150-
for server in servers:
151-
for delete_key in [MACHINE, CANDIDATE_MACHINE, AUTO_MIGRATION_ENABLED, SERVER_START]:
152-
if delete_key in servers[server]:
153-
del servers[server][delete_key]
156+
for key in servers:
157+
server = servers[key]
158+
for delete_key in [MACHINE, CANDIDATE_MACHINE, AUTO_MIGRATION_ENABLED, SERVER_START, LISTEN_ADDRESS,
159+
INTERFACE_ADDRESS]:
160+
if delete_key in server:
161+
del server[delete_key]
162+
163+
access_points = dictionary_utils.get_dictionary_element(server, NETWORK_ACCESS_POINT)
164+
for access_key in access_points:
165+
access_point = access_points[access_key]
166+
for delete_key in [CLUSTER_ADDRESS]:
167+
if delete_key in access_point:
168+
del access_point[delete_key]
154169

155170
security_configuration = dictionary_utils.get_dictionary_element(topology, SECURITY_CONFIGURATION)
156171
for delete_key in [NODE_MANAGER_USER_NAME, NODE_MANAGER_PW_ENCRYPTED]:
@@ -166,10 +181,17 @@ def filter_topology(model, _model_context):
166181
auto_migration_enabled = dictionary_utils.get_element(server_template, AUTO_MIGRATION_ENABLED)
167182
if auto_migration_enabled is None or alias_utils.convert_boolean(auto_migration_enabled):
168183
server_template[AUTO_MIGRATION_ENABLED] = PyRealBoolean(False)
169-
for delete_key in [MACHINE, SERVER_START]:
184+
for delete_key in [MACHINE, SERVER_START, LISTEN_ADDRESS, INTERFACE_ADDRESS]:
170185
if delete_key in server_template:
171186
del server_template[delete_key]
172187

188+
access_points = dictionary_utils.get_dictionary_element(server_template, NETWORK_ACCESS_POINT)
189+
for access_key in access_points:
190+
access_point = access_points[access_key]
191+
for delete_key in [CLUSTER_ADDRESS]:
192+
if delete_key in access_point:
193+
del access_point[delete_key]
194+
173195

174196
def filter_resources(model, _model_context):
175197
"""

0 commit comments

Comments
 (0)