Skip to content

Commit c72f494

Browse files
Save without testing
1 parent 7ec2a31 commit c72f494

File tree

9 files changed

+499
-18
lines changed

9 files changed

+499
-18
lines changed

core/src/main/python/create.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from wlsdeploy.logging.platform_logger import PlatformLogger
3434
from wlsdeploy.tool.create.domain_creator import DomainCreator
3535
from wlsdeploy.tool.create.domain_typedef import DomainTypedef
36+
from wlsdeploy.tool.create.domain_typedef import CREATE_DOMAIN
3637
from wlsdeploy.tool.util import filter_helper
3738
from wlsdeploy.tool.validate.validator import Validator
3839
from wlsdeploy.util import getcreds
@@ -44,7 +45,8 @@
4445
from wlsdeploy.util.model_translator import FileToPython
4546
from wlsdeploy.util.weblogic_helper import WebLogicHelper
4647

47-
_program_name = 'createDomain'
48+
_program_name = CREATE_DOMAIN
49+
4850
_class_name = 'create'
4951
__logger = PlatformLogger('wlsdeploy.create')
5052
__wlst_mode = WlstModes.OFFLINE

core/src/main/python/update.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from wlsdeploy.exception.expection_types import ExceptionType
3434
from wlsdeploy.logging.platform_logger import PlatformLogger
3535
from wlsdeploy.tool.create.domain_typedef import DomainTypedef
36+
from wlsdeploy.tool.create.domain_typedef import UPDATE_DOMAIN
3637
from wlsdeploy.tool.deploy import deployer_utils
3738
from wlsdeploy.tool.deploy import model_deployer
3839
from wlsdeploy.tool.deploy.topology_updater import TopologyUpdater
@@ -50,7 +51,7 @@
5051
from wlsdeploy.util.weblogic_helper import WebLogicHelper
5152

5253

53-
_program_name = 'updateDomain'
54+
_program_name = UPDATE_DOMAIN
5455
_class_name = 'update'
5556
__logger = PlatformLogger('wlsdeploy.update')
5657
__wls_helper = WebLogicHelper(__logger)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def get_wlst_flattened_mbean_name(self, location):
318318
"""
319319
Get the flattened WLST folder name.
320320
:param location: the location
321-
:return: the flattened folder name
321+
:return: the flattened folder name
322322
:raises: AliasException: if an error occurs due to a bad location or bad alias data
323323
"""
324324
return self._alias_entries.get_wlst_flattened_name_for_location(location)

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from wlsdeploy.exception import exception_helper
5050
from wlsdeploy.exception.expection_types import ExceptionType
5151
from wlsdeploy.tool.create.creator import Creator
52-
from wlsdeploy.tool.create.security_provider_creator import SecurityProviderCreator
52+
from wlsdeploy.tool.create.security_provider_handler import SecurityProviderHandler
5353
from wlsdeploy.tool.deploy import model_deployer
5454
from wlsdeploy.tool.util.archive_helper import ArchiveHelper
5555
from wlsdeploy.tool.util.library_helper import LibraryHelper
@@ -80,7 +80,7 @@ def __init__(self, model_dictionary, model_context, aliases):
8080
raise ex
8181

8282
self.topology_helper = TopologyHelper(self.aliases, ExceptionType.CREATE, self.logger)
83-
self.security_provider_creator = SecurityProviderCreator(model_dictionary, model_context, aliases,
83+
self.security_provider_creator = SecurityProviderHandler(model_dictionary, model_context, aliases,
8484
ExceptionType.CREATE, self.logger)
8585

8686
self._domain_typedef = self.model_context.get_domain_typedef()
@@ -248,6 +248,13 @@ def __create_domain(self):
248248
self.__create_base_domain(self._domain_home)
249249
self.__extend_domain(self._domain_home)
250250

251+
# SecurityConfiguration is special since the subfolder name does not change when you change the domain name.
252+
# It only changes once the domain is written and re-read...
253+
location = LocationContext()
254+
domain_name_token = self.alias_helper.get_name_token(location)
255+
security_config_location = LocationContext().add_name_token(domain_name_token, self._domain_name)
256+
self.security_provider_creator.create_security_configuration(security_config_location)
257+
251258
if len(self.files_to_extract_from_archive) > 0:
252259
for file_to_extract in self.files_to_extract_from_archive:
253260
self.archive_helper.extract_file(file_to_extract)
@@ -403,10 +410,6 @@ def __apply_base_domain_config(self, topology_folder_list):
403410
self.__create_security_folder(location)
404411
topology_folder_list.remove(SECURITY)
405412

406-
# SecurityConfiguration is special since the subfolder name does not change when you change the domain name.
407-
# It only changes once the domain is written and re-read...
408-
security_config_location = LocationContext().add_name_token(domain_name_token, self.__default_domain_name)
409-
self.security_provider_creator.create_security_configuration(security_config_location)
410413
topology_folder_list.remove(SECURITY_CONFIGURATION)
411414

412415
self.__create_mbeans_used_by_topology_mbeans(location, topology_folder_list)

core/src/main/python/wlsdeploy/tool/create/domain_typedef.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55
import javaos as os
@@ -14,6 +14,9 @@
1414
from wlsdeploy.util.cla_utils import CommandLineArgUtil
1515
from wlsdeploy.util.weblogic_helper import WebLogicHelper
1616

17+
CREATE_DOMAIN = 'createDomain'
18+
UPDATE_DOMAIN = 'updateDomain'
19+
1720

1821
class DomainTypedef(object):
1922
"""
@@ -38,6 +41,7 @@ def __init__(self, program_name, domain_type):
3841
self._logger = PlatformLogger('wlsdeploy.create')
3942
self._program_name = program_name
4043
self._domain_type = domain_type
44+
self.wls_helper = WebLogicHelper(self._logger)
4145

4246
self._domain_typedef_filename = \
4347
os.path.join(self.__domain_typedefs_location, domain_type + self.__domain_typedef_extension)
@@ -206,6 +210,16 @@ def is_system_wldf(self, name):
206210
"""
207211
return self._is_system_name(name, 'wldf')
208212

213+
def configure_realm_is_supported_by_tool(self, realm):
214+
"""
215+
Determine if the realm can be configured. Currently, update domain does not support configuration of any
216+
realm.
217+
#param realm_name: can the tool configure this realm
218+
:return: True if the security realm can be configured
219+
"""
220+
# self.wls_helper.get_default_security_realm_name() == realm_name
221+
return self._program_name != UPDATE_DOMAIN
222+
209223
def _is_system_name(self, name, key):
210224
"""
211225
Determine if the specified name matches a WLS name of the specified type key.
@@ -272,12 +286,12 @@ def __get_version_typedef(self):
272286
"""
273287
_method_name = '__get_version_typedef'
274288

275-
if not 'versions' in self._domain_typedefs_dict:
289+
if 'versions' not in self._domain_typedefs_dict:
276290
ex = exception_helper.create_create_exception('WLSDPLY-12304', self._domain_type,
277291
self._domain_typedef_filename)
278292
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
279293
raise ex
280-
elif not 'definitions' in self._domain_typedefs_dict:
294+
elif 'definitions' not in self._domain_typedefs_dict:
281295
ex = exception_helper.create_create_exception('WLSDPLY-12305', self._domain_type,
282296
self._domain_typedef_filename)
283297
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
@@ -309,23 +323,22 @@ def __match_version_typedef(self, versions_dict):
309323
self._logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
310324
raise ex
311325

312-
wls_helper = WebLogicHelper(self._logger)
313-
wls_version = wls_helper.get_actual_weblogic_version()
326+
wls_version = self.wls_helper.get_actual_weblogic_version()
314327
self._logger.fine('WLSDPLY-12310', wls_version, class_name=self.__class_name, method_name=_method_name)
315328

316329
result = None
317330
if wls_version in versions_dict:
318331
result = versions_dict[wls_version]
319332
else:
320-
new_version = wls_helper.get_next_higher_order_version_number(wls_version)
333+
new_version = self.wls_helper.get_next_higher_order_version_number(wls_version)
321334
while new_version is not None:
322335
if new_version in versions_dict:
323336
result = versions_dict[new_version]
324337
self._logger.finer('WLSDPLY-12308', self._domain_type, self._domain_typedef_filename,
325338
new_version, wls_version, class_name=self.__class_name, method_name=_method_name)
326339
break
327340
else:
328-
new_version = wls_helper.get_next_higher_order_version_number(new_version)
341+
new_version = self.wls_helper.get_next_higher_order_version_number(new_version)
329342

330343
if result is None:
331344
ex = exception_helper.create_create_exception('WLSDPLY-12309', self._domain_type,

core/src/main/python/wlsdeploy/tool/create/security_provider_creator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
The Universal Permissive License (UPL), Version 1.0
44
"""
5+
import warnings
56

67
from wlsdeploy.aliases.location_context import LocationContext
78
from wlsdeploy.aliases.model_constants import ACTIVE_TYPE
@@ -40,15 +41,18 @@
4041

4142
class SecurityProviderCreator(Creator):
4243
"""
43-
The class that drives security provider creation and updates.
44-
Shared by create domain and update domain.
44+
This class has been deprecated. There is no way to successfully handle the AuthenticationProviders in
45+
offline wlst for the default security realm in 11g. You cannot change the names of both providers in
46+
the AuthenticationProvider during create domain which uses offline wlst.
4547
"""
4648
__class_name = 'SecurityProviderHelper'
4749

4850
def __init__(self, model_dictionary, model_context, aliases, exception_type, logger):
4951
Creator.__init__(self, model_dictionary, model_context, aliases, exception_type, logger)
5052

5153
self._topology = self.model.get_model_topology()
54+
warnings.warn('Deprecated class. Use SecurityProviderHelper instead', DeprecationWarning)
55+
return
5256

5357
#
5458
# Creating domains with the wls.jar template is busted for pre-12.1.2 domains with regards to the

0 commit comments

Comments
 (0)