Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions core/src/main/python/wlsdeploy/tool/create/domain_creator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
The Universal Permissive License (UPL), Version 1.0
"""
import javaos as os
Expand Down Expand Up @@ -146,7 +146,7 @@ def create(self):
self.__run_rcu()
self.__fail_mt_1221_domain_creation()
self.__create_domain()
self.__deploy_resources_and_apps()
self.__deploy()
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
return

Expand Down Expand Up @@ -249,20 +249,28 @@ def __create_domain(self):
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
return

def __deploy(self):
"""
Update the domain with domain attributes, resources and deployments.
:raises: CreateException: if an error occurs while reading or updating the domain.
"""
self.model_context.set_domain_home(self._domain_home)
self.wlst_helper.read_domain(self._domain_home)
self.__set_domain_attributes()
self.__deploy_resources_and_apps()
self.wlst_helper.update_domain()
self.wlst_helper.close_domain()
return

def __deploy_resources_and_apps(self):
"""
Deploy the resources and applications.
:raises: CreateException: if an error occurs while reading or updating the domain.
:raises: DeployException: if an error occurs while deploy the resources or applications
"""
_method_name = '__deploy_resources_and_apps'

self.logger.entering(class_name=self.__class_name, method_name=_method_name)
self.model_context.set_domain_home(self._domain_home)
self.wlst_helper.read_domain(self._domain_home)
model_deployer.deploy_resources_and_apps_for_create(self.model, self.model_context, self.aliases)
self.wlst_helper.update_domain()
self.wlst_helper.close_domain()
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
return

Expand Down Expand Up @@ -383,6 +391,7 @@ def __apply_base_domain_config(self, topology_folder_list):
location.add_name_token(domain_name_token, self._domain_name)

self.__set_core_domain_params()

self.__create_security_folder(location)
topology_folder_list.remove(SECURITY)

Expand All @@ -408,6 +417,7 @@ def __apply_base_domain_config(self, topology_folder_list):
topology_folder_list.remove(MIGRATABLE_TARGET)

self.__create_other_domain_artifacts(location, topology_folder_list)

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

Expand Down Expand Up @@ -811,3 +821,19 @@ def __set_admin_server_name(self):
else:
self._admin_server_name = self.__default_admin_server_name
return

def __set_domain_attributes(self):
"""
Set the Domain attributes, which are in the top folder
:param location: current location context
"""
_method_name = '__set_domain_attributes'
self.logger.finer('WLSDPLY-12231', self._domain_name, class_name=self.__class_name, method_name=_method_name)
attrib_dict = dictionary_utils.get_dictionary_attributes(self.model.get_model_topology())
if DOMAIN_NAME in attrib_dict:
del attrib_dict[DOMAIN_NAME]
location = LocationContext()
attribute_path = self.alias_helper.get_wlst_attributes_path(location)
self.wlst_helper.cd(attribute_path)
self._set_attributes(location, attrib_dict)
return
18 changes: 17 additions & 1 deletion core/src/main/python/wlsdeploy/tool/deploy/topology_updater.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
The Universal Permissive License (UPL), Version 1.0
"""
from wlsdeploy.aliases.location_context import LocationContext
from wlsdeploy.aliases.model_constants import CLUSTER
from wlsdeploy.aliases.model_constants import DOMAIN_NAME
from wlsdeploy.aliases.model_constants import MACHINE
from wlsdeploy.aliases.model_constants import MIGRATABLE_TARGET
from wlsdeploy.aliases.model_constants import SECURITY
Expand Down Expand Up @@ -75,6 +76,9 @@ def update(self):
self._security_provider_creator.create_security_configuration(location)
folder_list.remove(SECURITY_CONFIGURATION)

# set the domain attributes
self._set_domain_attributes()

self._process_section(self._topology, folder_list, MACHINE, location)
self._process_section(self._topology, folder_list, UNIX_MACHINE, location)

Expand Down Expand Up @@ -114,3 +118,15 @@ def _process_section(self, folder_dict, folder_list, key, location):

if key in folder_list:
folder_list.remove(key)

def _set_domain_attributes(self):
_method_name = '_set_domain_attributes'
self.logger.fine('WLSDPLY-09700', self.model_context.get_domain_name(), class_name=self._class_name,
method_name=_method_name)
attrib_dict = dictionary_utils.get_dictionary_attributes(self._topology)
if DOMAIN_NAME in attrib_dict:
del attrib_dict[DOMAIN_NAME]
location = LocationContext()
attribute_path = self.alias_helper.get_wlst_attributes_path(location)
self.wlst_helper.cd(attribute_path)
self.set_attributes(location, attrib_dict)
16 changes: 15 additions & 1 deletion core/src/main/python/wlsdeploy/util/dictionary_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
The Universal Permissive License (UPL), Version 1.0
"""
import java.util.Properties as JProperties
Expand All @@ -26,6 +26,20 @@ def get_dictionary_element(dictionary, element_name):
return result


def get_dictionary_attributes(dictionary):
"""
Get the attributes and skip the dictionary attributes from the dictionary.
:param dictionary: to return the skimmed down attribute list
:return: list of attributes
"""
result_list = OrderedDict()
if dictionary:
for key, value in dictionary.iteritems():
if not isinstance(value, dict):
result_list[key] = value
return result_list


def is_empty_dictionary_element(dictionary, element_name):
"""
Determine if the element in the dictionary for the element name is not present or empty.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"copyright": "Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.",
"copyright": "Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.",
"license": "The Universal Permissive License (UPL), Version 1.0",
"wlst_type": "",
"folders": {},
Expand Down Expand Up @@ -46,8 +46,7 @@
"ParallelDeployApplicationModules": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ParallelDeployApplicationModules", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ],
"ParallelDeployApplications": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "ParallelDeployApplications", "wlst_path": "WP001", "value": {"default": "${false:true}"}, "wlst_type": "boolean" } ],
"PartitionUriSpace": [ {"version": "[12.2.1.1,)", "wlst_mode": "both", "wlst_name": "PartitionUriSpace", "wlst_path": "WP001", "value": {"default": "/partitions" }, "wlst_type": "string" } ],
"ProductionModeEnabled": [ {"version": "[10,12.2.1.3)", "wlst_mode": "both", "wlst_name": "ProductionModeEnabled", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ,
{"version": "[12.2.1.3,)", "wlst_mode": "both", "wlst_name": "ProductionModeEnabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean" } ],
"ProductionModeEnabled": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ProductionModeEnabled", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean" } ],
"RootDirectory": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "RootDirectory", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO", "uses_path_tokens": "true"} ],
"ServerMigrationHistorySize": [ {"version": "[12.1.2,12.2.1.1)", "wlst_mode": "both", "wlst_name": "ServerMigrationHistorySize", "wlst_path": "WP001", "value": {"default": "-1" }, "wlst_type": "integer", "restart_required": "true" },
{"version": "[12.2.1.1,12.2.1.3)","wlst_mode": "both", "wlst_name": "ServerMigrationHistorySize", "wlst_path": "WP001", "value": {"default": "-1" }, "wlst_type": "integer" } ,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
# The Universal Permissive License (UPL), Version 1.0
#
#
Expand Down Expand Up @@ -900,6 +900,9 @@ WLSDPLY-09610=Updating {0} {1} in {2} {3}
# wlsdeploy/tool/deploy/model_deployer.py
WLSDPLY-09650=Deployment failed due to WLST exception {0}

# wlsdeploy/tool/deploy/topology_updater.py
WLSDPLY-09700=Update Domain {0} domain level attributes

###############################################################################
# create messages (12000 - 14999) #
###############################################################################
Expand Down Expand Up @@ -978,6 +981,7 @@ WLSDPLY-12227=Changing domain name from {0} to {1}
WLSDPLY-12228=The model does not define the required attribute {0} in the {1} section of the model
WLSDPLY-12229=Changing the administration server name from {0} to {1}
WLSDPLY-12230=Creating placeholder for Coherence cluster {0}
WLSDPLY-12231=Apply Domain {0} domain level attributes

# domain_typedef.py
WLSDPLY-12300={0} got the domain type {1} but the domain type definition file {2} was not valid: {3}
Expand Down