Skip to content

Commit e78b39b

Browse files
jshum2479Johnny
authored andcommitted
fix regular rcu db in yaml problem
1 parent 7145c03 commit e78b39b

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
@@ -419,15 +419,22 @@ def unzip_atp_wallet(wallet_file, location):
419419

420420

421421
def validateRCUArgsAndModel(model_context, model):
422-
has_atp = 0
423-
if model_constants.RCU_DB_INFO in model[model_constants.DOMAIN_INFO]:
424-
# extract the wallet first
425-
has_atp = 1
426-
has_tns_admin = model_constants.DRIVER_PARAMS_NET_TNS_ADMIN in model[model_constants.DOMAIN_INFO][
422+
has_atpdbinfo = 0
423+
domain_info = model[model_constants.DOMAIN_INFO]
424+
if model_constants.RCU_DB_INFO in domain_info:
425+
has_tns_admin = model_constants.DRIVER_PARAMS_NET_TNS_ADMIN in domain_info[
427426
model_constants.RCU_DB_INFO]
428-
if model_context.get_archive_file_name():
429-
# if it does not have the oracle.net.tns_admin specified, then extract to
427+
has_regular_db = model_constants.RCU_DB_CONN in domain_info[model_constants.RCU_DB_INFO]
428+
429+
if model_constants.ATP_TNS_ENTRY in domain_info[model_constants.RCU_DB_INFO]:
430+
has_atpdbinfo = 1
431+
432+
if model_context.get_archive_file_name() and not has_regular_db:
433+
# 1. If it does not have the oracle.net.tns_admin specified, then extract to domain/atpwallet
434+
# 2. If it is plain old regular oracle db, do nothing
435+
# 3. If it deos not have tns_admin in the model, then the wallet must be in the archive
430436
if not has_tns_admin:
437+
# extract the wallet first
431438
archive_file = WLSDeployArchive(model_context.get_archive_file_name())
432439
atp_path = archive_file.getATPWallet()
433440
if atp_path and model[model_constants.TOPOLOGY]['Name']:
@@ -447,20 +454,16 @@ def validateRCUArgsAndModel(model_context, model):
447454
class_name=_class_name, method_name="validateRCUArgsAndModel")
448455
__clean_up_temp_files()
449456
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
450-
elif not has_tns_admin:
451-
__logger.severe('WLSDPLY-12411', error=None,
452-
class_name=_class_name, method_name="validateRCUArgsAndModel")
453-
__clean_up_temp_files()
454-
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
455-
456-
if not has_atp and model_context.get_domain_type() not in ['WLS', 'RestrictedJRF']:
457-
if not model_context.get_rcu_database() or not model_context.get_rcu_prefix():
458-
__logger.severe('WLSDPLY-12408', model_context.get_domain_type(), CommandLineArgUtil.RCU_DB_SWITCH,
457+
458+
else:
459+
if model_context.get_domain_type() not in ['WLS', 'RestrictedJRF']:
460+
if not model_context.get_rcu_database() or not model_context.get_rcu_prefix():
461+
__logger.severe('WLSDPLY-12408', model_context.get_domain_type(), CommandLineArgUtil.RCU_DB_SWITCH,
459462
CommandLineArgUtil.RCU_PREFIX_SWITCH)
460-
__clean_up_temp_files()
461-
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
463+
__clean_up_temp_files()
464+
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
462465

463-
return has_atp
466+
return has_atpdbinfo
464467

465468

466469
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
@@ -773,9 +773,9 @@ def __configure_fmw_infra_database(self):
773773
# For ATP databases : we need to set all the property for each datasource
774774
# load atp connection properties from properties file
775775
#
776+
domain_info = self.model.get_model_domain_info()
776777

777-
if RCU_DB_INFO in self.model.get_model_domain_info():
778-
domain_info = self.model.get_model_domain_info()
778+
if RCU_DB_INFO in domain_info:
779779
rcu_properties_map = domain_info[RCU_DB_INFO]
780780
#rcu_properties_map = self.model.get_model_domain_info()[RCU_DB_INFO]
781781
# HANDLE ATP case
@@ -860,12 +860,17 @@ def __configure_fmw_infra_database(self):
860860
self.__set_atp_connection_property(location, DRIVER_PARAMS_NET_FAN_ENABLED, 'false')
861861

862862
if not has_atp:
863-
rcu_database = self.model_context.get_rcu_database()
864-
if rcu_database is None:
865-
return
863+
if RCU_DB_INFO in domain_info:
864+
rcu_prefix = domain_info[RCU_DB_INFO][RCU_PREFIX]
865+
rcu_database = domain_info[RCU_DB_INFO][RCU_DB_CONN]
866+
rcu_schema_pwd = domain_info[RCU_DB_INFO][RCU_SCHEMA_PASSWORD]
867+
else:
868+
rcu_database = self.model_context.get_rcu_database()
869+
if rcu_database is None:
870+
return
871+
rcu_prefix = self.model_context.get_rcu_prefix()
872+
rcu_schema_pwd = self.model_context.get_rcu_schema_pass()
866873

867-
rcu_prefix = self.model_context.get_rcu_prefix()
868-
rcu_schema_pwd = self.model_context.get_rcu_schema_pass()
869874
fmw_database = self.wls_helper.get_jdbc_url_from_rcu_connect_string(rcu_database)
870875
self.logger.fine('WLSDPLY-12221', fmw_database, class_name=self.__class_name, method_name=_method_name)
871876

0 commit comments

Comments
 (0)