Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b4e3843
Apply JRF resources to dynamic cluster
CarolynRountree Mar 18, 2019
c0a08ce
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Mar 22, 2019
e4c2c24
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Mar 22, 2019
1b9c11a
Add troubleshooting message for applyJRF
CarolynRountree Mar 22, 2019
e85a241
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Mar 22, 2019
285f19a
intermediate checkins
CarolynRountree Mar 25, 2019
1c4800b
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Mar 25, 2019
4a09ad9
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Mar 25, 2019
a9aa349
assign JRF resources using applyJRF
CarolynRountree Mar 27, 2019
86b7bb1
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Mar 27, 2019
ae9c16e
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Apr 1, 2019
f0abc7f
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Apr 1, 2019
5a8af7d
One working approach
CarolynRountree Apr 15, 2019
cc8957d
Add rearrangement of execution of targeting
CarolynRountree Apr 15, 2019
2e6f9d2
Checkin cleanups
CarolynRountree Apr 15, 2019
db0a172
fixes for exception issue message
CarolynRountree Apr 15, 2019
3234c17
Fixes for 10.3.6 testing
CarolynRountree Apr 16, 2019
0f0b6ca
cleanup
CarolynRountree Apr 17, 2019
594f668
Revert "cleanup"
CarolynRountree Apr 17, 2019
eaeecd3
Merge branch 'WDT-228-target-dynamic-servers-to-cluster' of github.co…
CarolynRountree Apr 17, 2019
4990c4b
Merge branch 'master' into WDT-228-target-dynamic-servers-to-cluster
CarolynRountree Apr 17, 2019
1d6e4b1
WDT-228 Remove archive file from repository
CarolynRountree Apr 17, 2019
ad00fd5
clarify warning message 12244
ddsharpe Apr 17, 2019
ab43188
changed warning message 9701
ddsharpe Apr 17, 2019
364cef5
Merge master and test. Add new check for RestrictedJRF and change met…
CarolynRountree Apr 18, 2019
62de3c3
Merge branch 'WDT-228-target-dynamic-servers-to-cluster' of github.co…
CarolynRountree Apr 18, 2019
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added core/lib/amauthprovider.jar
Binary file not shown.
16 changes: 16 additions & 0 deletions core/src/main/java/oracle/weblogic/deploy/util/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,20 @@ public static String[] splitCommaSeparatedList(String listString) {
return listString.split(COMMA_SEPARATED_LIST_SPLITTER);
}

/**
* Return a printable string representing the Boolean True or False value for the integer.
* @param value containing the integer value of a boolean
* @return String representation of the boolean integer
*/
public static String stringForBoolean(int value) {
switch(value) {
case 0:
return Boolean.FALSE.toString();
case 1:
return Boolean.TRUE.toString();
default:
return "UNKNOWN";
}
}

}
6 changes: 3 additions & 3 deletions core/src/main/python/wlsdeploy/tool/create/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
from wlsdeploy.exception import exception_helper
from wlsdeploy.exception.expection_types import ExceptionType
from wlsdeploy.logging.platform_logger import PlatformLogger
from wlsdeploy.tool.deploy import deployer_utils
from wlsdeploy.util import dictionary_utils
from wlsdeploy.tool.util.alias_helper import AliasHelper
from wlsdeploy.tool.util.attribute_setter import AttributeSetter
from wlsdeploy.tool.util.custom_folder_helper import CustomFolderHelper
from wlsdeploy.tool.util.wlst_helper import WlstHelper
from wlsdeploy.util import dictionary_utils
from wlsdeploy.util.model import Model
from wlsdeploy.util.weblogic_helper import WebLogicHelper

from wlsdeploy.tool.deploy import deployer_utils


class Creator(object):
"""
Expand Down
16 changes: 10 additions & 6 deletions core/src/main/python/wlsdeploy/tool/create/domain_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""
import javaos as os
from oracle.weblogic.deploy.create import RCURunner

from wlsdeploy.aliases.location_context import LocationContext
from wlsdeploy.aliases.model_constants import ADMIN_PASSWORD
from wlsdeploy.aliases.model_constants import ADMIN_SERVER_NAME
Expand Down Expand Up @@ -409,8 +408,6 @@ def __extend_domain(self, domain_home):
self.target_helper.target_server_groups_to_servers(server_groups_to_target)
self.wlst_helper.update_domain()
elif self._domain_typedef.domain_type_has_jrf_resources():
# Update the domain to apply the extension templates.
self.wlst_helper.update_domain()
self.target_helper.target_jrf_groups_to_clusters_servers(domain_home)

self.wlst_helper.close_domain()
Expand Down Expand Up @@ -451,13 +448,20 @@ def __create_domain_with_select_template(self, domain_home):
self.__set_app_dir()
self.__configure_fmw_infra_database()

server_groups_to_target = self._domain_typedef.get_server_groups_to_target()
self.target_helper.target_server_groups_to_servers(server_groups_to_target)

self.logger.info('WLSDPLY-12206', self._domain_name, domain_home,
class_name=self.__class_name, method_name=_method_name)

server_groups_to_target = self._domain_typedef.get_server_groups_to_target()
server_assigns, dynamic_assigns = self.target_helper.target_server_groups_to_servers(server_groups_to_target)
if server_assigns is not None:
self.target_helper.target_server_groups(server_assigns)

self.wlst_helper.write_domain(domain_home)
self.wlst_helper.close_template()

if dynamic_assigns is not None:
self.target_helper.target_server_groups_to_dynamic_clusters(dynamic_assigns)

self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
return

Expand Down
15 changes: 15 additions & 0 deletions core/src/main/python/wlsdeploy/tool/create/domain_typedef.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ def domain_type_has_jrf_resources(self):
"""
return 'JRF-MAN-SVR' in self.get_server_groups_to_target()

def domain_type_is_restricted_jrf(self):
"""
A workaround for a bug with applyJRF in online with RestrictedJRF
:return:
"""
return self.get_domain_type() == 'RestrictedJRF'

def get_base_template(self):
"""
Get the base template to use when create the domain.
Expand All @@ -118,6 +125,14 @@ def get_base_template(self):
self.__resolve_paths()
return self._domain_typedef['baseTemplate']

def has_extension_templates(self):
"""
Determine if the domain type has extension templates.
:return: True if the domain type will apply extension templates
"""
ets = self.get_extension_templates()
return ets is not None and len(ets) > 0

def get_extension_templates(self):
"""
Get the list of extension templates to apply when create/extending the domain.
Expand Down
41 changes: 0 additions & 41 deletions core/src/main/python/wlsdeploy/tool/deploy/deployer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,44 +279,3 @@ def get_file_hash(file_name):
raise ex
_logger.exiting(class_name=_class_name, method_name=_method_name, result=result)
return result


def save_changes(model_context):
"""
Call this if necessary to save changes and disconnect from the domain.
This works in both offline and online.
:param model_context: contains information about the current tool settings
"""
_method_name = 'save_changes'
if model_context.get_target_wlst_mode() == WlstModes.ONLINE:
if _wlst_helper.is_connected():
_logger.fine('WLSDPLY-09110', class_name=_class_name, method_name=_method_name)
_wlst_helper.save()
_wlst_helper.activate()
_wlst_helper.disconnect()
else:
_logger.fine('WLSDPLY-09109', class_name=_class_name, method_name=_method_name)
else:
_logger.fine('WLSDPLY-09111', class_name=_class_name, method_name=_method_name)
_wlst_helper.update_domain()


def read_again(model_context):
"""
Establish connection with the domain and start editing in both online and offline wlst mode.
:param model_context: contains information about the current tool settings
"""
_method_name = 'read_again'
if model_context.get_target_wlst_mode() == WlstModes.ONLINE:
if not _wlst_helper.is_connected():
_logger.fine('WLSDPLY-09113', class_name=_class_name, method_name=_method_name)
_wlst_helper.connect(model_context.get_admin_user(), model_context.get_admin_password(),
model_context.get_admin_url())
_wlst_helper.edit()
_wlst_helper.start_edit()
else:
_logger.fine('WLSDPLY-09112', class_name=_class_name, method_name=_method_name)
else:
_logger.fine('WLSDPLY-09114', class_name=_class_name, method_name=_method_name)
_wlst_helper.close_domain()
_wlst_helper.read_domain(model_context.get_domain_home())
92 changes: 82 additions & 10 deletions core/src/main/python/wlsdeploy/tool/deploy/topology_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from wlsdeploy.aliases.model_constants import SERVER_TEMPLATE
from wlsdeploy.aliases.model_constants import UNIX_MACHINE
from wlsdeploy.aliases.wlst_modes import WlstModes
from wlsdeploy.exception import exception_helper
from wlsdeploy.exception.expection_types import ExceptionType
from wlsdeploy.tool.create.security_provider_creator import SecurityProviderCreator
from wlsdeploy.tool.deploy import deployer_utils
Expand All @@ -34,16 +35,17 @@ def __init__(self, model, model_context, aliases, wlst_mode=WlstModes.OFFLINE):
Deployer.__init__(self, model, model_context, aliases, wlst_mode)
self._topology = self.model.get_model_topology()
self._resources = self.model.get_model_resources()
self._topology_helper = TopologyHelper(self.aliases, ExceptionType.DEPLOY, self.logger)
self._exception_type = ExceptionType.DEPLOY
self._topology_helper = TopologyHelper(self.aliases, self._exception_type, self.logger)
self._domain_typedef = self.model_context.get_domain_typedef()

self._security_provider_creator = SecurityProviderCreator(model.get_model(), model_context, aliases,
ExceptionType.DEPLOY, self.logger)
self._exception_type, self.logger)

self.library_helper = LibraryHelper(self.model, self.model_context, self.aliases,
model_context.get_domain_home(), ExceptionType.DEPLOY, self.logger)
model_context.get_domain_home(), self._exception_type, self.logger)

self.target_helper = TargetHelper(self.model, self.model_context, self.aliases, ExceptionType.DEPLOY,
self.target_helper = TargetHelper(self.model, self.model_context, self.aliases, self._exception_type,
self.logger)

# Override
Expand Down Expand Up @@ -72,7 +74,11 @@ def update(self):
"""
Deploy resource model elements at the domain level, including multi-tenant elements.
"""
# For issue in setServerGroups in online mode (new configured clusters and stand-alone managed servers
# will not have extension template resources targeted)
existing_managed_servers, existing_configured_clusters = self._get_lists_with_issues()
domain_token = deployer_utils.get_domain_token(self.alias_helper)

location = LocationContext()
location.add_name_token(domain_token, self.model_context.get_domain_name())

Expand Down Expand Up @@ -104,24 +110,32 @@ def update(self):
# create placeholders for Servers that are in a cluster as /Server/JTAMigratableTarget
# can reference "other" servers
self._topology_helper.create_placeholder_servers_in_cluster(self._topology)

self._process_section(self._topology, folder_list, SERVER, location)

self._process_section(self._topology, folder_list, MIGRATABLE_TARGET, location)

new_managed_server_list, new_configured_cluster_list = self._get_lists_with_issues()

self._check_for_issue(existing_managed_servers, new_managed_server_list)
self._check_for_issue(existing_configured_clusters, new_configured_cluster_list)

# process remaining top-level folders. copy list to avoid concurrent update in loop
remaining = list(folder_list)
for folder_name in remaining:
self._process_section(self._topology, folder_list, folder_name, location)

if self.wls_helper.is_set_server_groups_supported():
server_groups_to_target = self._domain_typedef.get_server_groups_to_target()
self.target_helper.target_server_groups_to_servers(server_groups_to_target)
server_assigns, dynamic_assigns = self.target_helper.target_server_groups_to_servers(server_groups_to_target)
if dynamic_assigns is not None:
self.wlst_helper.save_and_close(self.model_context)
self.target_helper.target_server_groups_to_dynamic_clusters(dynamic_assigns)
self.wlst_helper.reopen(self.model_context)
if server_assigns is not None:
self.target_helper.target_server_groups(server_assigns)
elif self._domain_typedef.domain_type_has_jrf_resources():
deployer_utils.save_changes(self.model_context)
self.target_helper.target_jrf_groups_to_clusters_servers(self.model_context.get_domain_home())
deployer_utils.read_again(self.model_context)

# files referenced in attributes are extracted as attributes are processed
self.target_helper.target_jrf_groups_to_clusters_servers()

self.library_helper.install_domain_libraries()
self.library_helper.extract_classpath_libraries()
Expand Down Expand Up @@ -149,3 +163,61 @@ def _set_domain_attributes(self):
attribute_path = self.alias_helper.get_wlst_attributes_path(location)
self.wlst_helper.cd(attribute_path)
self.set_attributes(location, attrib_dict)

def _has_issue_potential(self):
return self.model_context.is_wlst_online() and self.model_context.get_domain_typedef().has_extension_templates()

def _check_for_issue(self, existing_list, new_list):
_method_name = '_check_for_issue'
if self._has_issue_potential() and \
len(existing_list) != len(new_list):
for entity_name in new_list:
if entity_name not in existing_list:
ex = exception_helper.create_exception(self._exception_type, 'WLSDPLY-09701')
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
raise ex
return

def _get_lists_with_issues(self):
_method_name = '_get_lists_with_issues'
self.logger.entering(class_name=self._class_name, method_name=_method_name)

if not self._has_issue_potential():
self.logger.exiting(class_name=self._class_name, method_name=_method_name, result='No issue potential')
return list(), list()

location = LocationContext().append_location(SERVER)
server_path = self.alias_helper.get_wlst_list_path(location)
existing_managed_servers = list()
existing_servers = self.wlst_helper.get_existing_object_list(server_path)
if existing_servers is not None:
name_token = self.alias_helper.get_name_token(location)
for server_name in existing_servers:
location.add_name_token(name_token, server_name)
wlst_path = self.alias_helper.get_wlst_attributes_path(location)
self.wlst_helper.cd(wlst_path)
cluster_attribute = self.alias_helper.get_wlst_attribute_name(location, CLUSTER)
cluster_value = self.wlst_helper.get(cluster_attribute)
if cluster_value is None:
existing_managed_servers.append(server_name)
location.remove_name_token(name_token)

existing_configured_clusters = list()
location = LocationContext().append_location(CLUSTER)
cluster_path = self.alias_helper.get_wlst_list_path(location)
existing_clusters = self.wlst_helper.get_existing_object_list(cluster_path)
if existing_clusters is not None:
name_token = self.alias_helper.get_name_token(location)
for cluster_name in existing_clusters:
location.add_name_token(name_token, cluster_name)
wlst_path = self.alias_helper.get_wlst_attributes_path(location)
self.wlst_helper.cd(wlst_path)
ds_mbean = self.alias_helper.get_wlst_mbean_type(location)
if not self.wlst_helper.subfolder_exists(ds_mbean, self.alias_helper.get_wlst_subfolders_path(location)):
existing_configured_clusters.append(cluster_name)
location.remove_name_token(name_token)

self.logger.exiting(class_name=self._class_name, method_name=_method_name,
result='configured_clusters=' + str(existing_configured_clusters) +
' managed servers=' + str(existing_managed_servers))
return existing_configured_clusters, existing_managed_servers
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
The Universal Permissive License (UPL), Version 1.0
"""
from com.sun.identity.agents.weblogic.v10 import AgentAuthenticatorMBeanImplBeanInfo
from com.sun.identity.agents.weblogic.v10 import AgentAuthenticatorMBeanImpl
from com.sun.identity.agents.weblogic.v10 import AgentAuthenticatorMBean
from com.sun.identity.agents.weblogic.v10 import AgentAuthenticatorImpl
from java.io import File
from java.lang import IllegalArgumentException

Expand Down Expand Up @@ -46,6 +50,7 @@ def __init__(self, model_context, topology_dictionary, base_location, wlst_mode=
self._add_att_handler(model_constants.CLASSPATH, self._add_classpath_libraries_to_archive)
self._add_att_handler(model_constants.CUSTOM_IDENTITY_KEYSTORE_FILE, self._add_keystore_file_to_archive)
self._add_att_handler(model_constants.CUSTOM_TRUST_KEYSTORE_FILE, self._add_keystore_file_to_archive)
self.agent_authenticator = AgentAuthenticatorImpl()

def discover(self):
"""
Expand Down
Loading