Skip to content

Commit c657e99

Browse files
committed
fix regular rcu db in yaml problem
1 parent 1b3d8e3 commit c657e99

File tree

2 files changed

+34
-26
lines changed

2 files changed

+34
-26
lines changed

core/src/main/python/create.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,22 @@ def unzip_atp_wallet(wallet_file, location):
414414

415415

416416
def validateRCUArgsAndModel(model_context, model):
417-
has_atp = 0
418-
if model_constants.RCU_DB_INFO in model[model_constants.DOMAIN_INFO]:
419-
# extract the wallet first
420-
has_atp = 1
421-
has_tns_admin = model_constants.DRIVER_PARAMS_NET_TNS_ADMIN in model[model_constants.DOMAIN_INFO][
417+
has_atpdbinfo = 0
418+
domain_info = model[model_constants.DOMAIN_INFO]
419+
if model_constants.RCU_DB_INFO in domain_info:
420+
has_tns_admin = model_constants.DRIVER_PARAMS_NET_TNS_ADMIN in domain_info[
422421
model_constants.RCU_DB_INFO]
423-
if model_context.get_archive_file_name():
424-
# if it does not have the oracle.net.tns_admin specified, then extract to
422+
has_regular_db = model_constants.RCU_DB_CONN in domain_info[model_constants.RCU_DB_INFO]
423+
424+
if model_constants.ATP_TNS_ENTRY in domain_info[model_constants.RCU_DB_INFO]:
425+
has_atpdbinfo = 1
426+
427+
if model_context.get_archive_file_name() and not has_regular_db:
428+
# 1. If it does not have the oracle.net.tns_admin specified, then extract to domain/atpwallet
429+
# 2. If it is plain old regular oracle db, do nothing
430+
# 3. If it deos not have tns_admin in the model, then the wallet must be in the archive
425431
if not has_tns_admin:
432+
# extract the wallet first
426433
archive_file = WLSDeployArchive(model_context.get_archive_file_name())
427434
atp_path = archive_file.getATPWallet()
428435
if atp_path and model[model_constants.TOPOLOGY]['Name']:
@@ -442,20 +449,16 @@ def validateRCUArgsAndModel(model_context, model):
442449
class_name=_class_name, method_name="validateRCUArgsAndModel")
443450
__clean_up_temp_files()
444451
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
445-
elif not has_tns_admin:
446-
__logger.severe('WLSDPLY-12411', error=None,
447-
class_name=_class_name, method_name="validateRCUArgsAndModel")
448-
__clean_up_temp_files()
449-
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
450-
451-
if not has_atp and model_context.get_domain_type() not in ['WLS', 'RestrictedJRF']:
452-
if not model_context.get_rcu_database() or not model_context.get_rcu_prefix():
453-
__logger.severe('WLSDPLY-12408', model_context.get_domain_type(), CommandLineArgUtil.RCU_DB_SWITCH,
452+
453+
else:
454+
if model_context.get_domain_type() not in ['WLS', 'RestrictedJRF']:
455+
if not model_context.get_rcu_database() or not model_context.get_rcu_prefix():
456+
__logger.severe('WLSDPLY-12408', model_context.get_domain_type(), CommandLineArgUtil.RCU_DB_SWITCH,
454457
CommandLineArgUtil.RCU_PREFIX_SWITCH)
455-
__clean_up_temp_files()
456-
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
458+
__clean_up_temp_files()
459+
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
457460

458-
return has_atp
461+
return has_atpdbinfo
459462

460463

461464
def main(args):

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,9 @@ def __configure_fmw_infra_database(self):
779779
# For ATP databases : we need to set all the property for each datasource
780780
# load atp connection properties from properties file
781781
#
782+
domain_info = self.model.get_model_domain_info()
782783

783-
if RCU_DB_INFO in self.model.get_model_domain_info():
784-
domain_info = self.model.get_model_domain_info()
784+
if RCU_DB_INFO in domain_info:
785785
rcu_properties_map = domain_info[RCU_DB_INFO]
786786
#rcu_properties_map = self.model.get_model_domain_info()[RCU_DB_INFO]
787787
# HANDLE ATP case
@@ -866,12 +866,17 @@ def __configure_fmw_infra_database(self):
866866
self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_FAN_ENABLED, 'false')
867867

868868
if not has_atp:
869-
rcu_database = self.model_context.get_rcu_database()
870-
if rcu_database is None:
871-
return
869+
if RCU_DB_INFO in domain_info:
870+
rcu_prefix = domain_info[RCU_DB_INFO][RCU_PREFIX]
871+
rcu_database = domain_info[RCU_DB_INFO][RCU_DB_CONN]
872+
rcu_schema_pwd = domain_info[RCU_DB_INFO][RCU_SCHEMA_PASSWORD]
873+
else:
874+
rcu_database = self.model_context.get_rcu_database()
875+
if rcu_database is None:
876+
return
877+
rcu_prefix = self.model_context.get_rcu_prefix()
878+
rcu_schema_pwd = self.model_context.get_rcu_schema_pass()
872879

873-
rcu_prefix = self.model_context.get_rcu_prefix()
874-
rcu_schema_pwd = self.model_context.get_rcu_schema_pass()
875880
fmw_database = self.wls_helper.get_jdbc_url_from_rcu_connect_string(rcu_database)
876881
self.logger.fine('WLSDPLY-12221', fmw_database, class_name=self.__class_name, method_name=_method_name)
877882

0 commit comments

Comments
 (0)