Skip to content

Commit 7cc7c5f

Browse files
authored
Merge pull request #310 from oracle/atpwaller4nonjrf
refactor and extract wallet for non jrf case
2 parents 6fd3159 + 0b50d63 commit 7cc7c5f

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

core/src/main/python/create.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ def validateRCUArgsAndModel(model_context, model):
351351
if not has_tns_admin:
352352
# extract the wallet first
353353
archive_file = WLSDeployArchive(model_context.get_archive_file_name())
354-
atp_wallet_zipentry = archive_file.getATPWallet()
354+
atp_wallet_zipentry = None
355+
if archive_file:
356+
atp_wallet_zipentry = archive_file.getATPWallet()
355357
if atp_wallet_zipentry and model[model_constants.TOPOLOGY]['Name']:
356358
extract_path = atp_helper.extract_walletzip(model, model_context, archive_file, atp_wallet_zipentry)
357359
# update the model to add the tns_admin
@@ -430,11 +432,20 @@ def main(args):
430432
try:
431433

432434
has_atp = validateRCUArgsAndModel(model_context, model)
435+
# check if there is an atpwallet and extract in the domain dir
436+
# it is to support non JRF domain but user wants to use ATP database
437+
if not has_atp:
438+
archive_file = WLSDeployArchive(model_context.get_archive_file_name())
439+
if archive_file:
440+
atp_wallet_zipentry = archive_file.getATPWallet()
441+
if atp_wallet_zipentry:
442+
atp_helper.extract_walletzip(model, model_context, archive_file, atp_wallet_zipentry)
443+
433444
creator = DomainCreator(model, model_context, aliases)
434445
creator.create()
435446

436447
if has_atp:
437-
atp_helper.fix_jsp_config(model, model_context)
448+
atp_helper.fix_jps_config(model, model_context)
438449
except CreateException, ex:
439450
__logger.severe('WLSDPLY-12409', _program_name, ex.getLocalizedMessage(), error=ex,
440451
class_name=_class_name, method_name=_method_name)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def unzip_atp_wallet(wallet_file, location):
8888
zis.close()
8989
fis.close()
9090

91-
def fix_jsp_config(model, model_context):
91+
def fix_jps_config(model, model_context):
9292
#print model[model_constants.DOMAIN_INFO][model_constants.ATP_DB_INFO]
9393
tns_admin = model[model_constants.DOMAIN_INFO][model_constants.RCU_DB_INFO][
9494
model_constants.DRIVER_PARAMS_NET_TNS_ADMIN]
@@ -183,7 +183,7 @@ def is_regular_db(rcu_db_info):
183183
return is_regular
184184

185185

186-
def extract_walletzip(model, model_context, archive_file, atp_path):
186+
def extract_walletzip(model, model_context, archive_file, atp_zipentry):
187187
domain_parent = model_context.get_domain_parent_dir()
188188
if domain_parent is None:
189189
domain_path = model_context.get_domain_home()
@@ -193,7 +193,7 @@ def extract_walletzip(model, model_context, archive_file, atp_path):
193193
extract_path = domain_path + os.sep + 'atpwallet'
194194
extract_dir = File(extract_path)
195195
extract_dir.mkdirs()
196-
wallet_zip = archive_file.extractFile(atp_path, File(domain_path))
196+
wallet_zip = archive_file.extractFile(atp_zipentry, File(domain_path))
197197
unzip_atp_wallet(wallet_zip, extract_path)
198198
os.remove(wallet_zip)
199199
return extract_path

0 commit comments

Comments
 (0)