Skip to content

refactor and extract wallet for non jrf case #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2019
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
15 changes: 13 additions & 2 deletions core/src/main/python/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,9 @@ def validateRCUArgsAndModel(model_context, model):
if not has_tns_admin:
# extract the wallet first
archive_file = WLSDeployArchive(model_context.get_archive_file_name())
atp_wallet_zipentry = archive_file.getATPWallet()
atp_wallet_zipentry = None
if archive_file:
atp_wallet_zipentry = archive_file.getATPWallet()
if atp_wallet_zipentry and model[model_constants.TOPOLOGY]['Name']:
extract_path = atp_helper.extract_walletzip(model, model_context, archive_file, atp_wallet_zipentry)
# update the model to add the tns_admin
Expand Down Expand Up @@ -430,11 +432,20 @@ def main(args):
try:

has_atp = validateRCUArgsAndModel(model_context, model)
# check if there is an atpwallet and extract in the domain dir
# it is to support non JRF domain but user wants to use ATP database
if not has_atp:
archive_file = WLSDeployArchive(model_context.get_archive_file_name())
if archive_file:
atp_wallet_zipentry = archive_file.getATPWallet()
if atp_wallet_zipentry:
atp_helper.extract_walletzip(model, model_context, archive_file, atp_wallet_zipentry)

creator = DomainCreator(model, model_context, aliases)
creator.create()

if has_atp:
atp_helper.fix_jsp_config(model, model_context)
atp_helper.fix_jps_config(model, model_context)
except CreateException, ex:
__logger.severe('WLSDPLY-12409', _program_name, ex.getLocalizedMessage(), error=ex,
class_name=_class_name, method_name=_method_name)
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/python/wlsdeploy/tool/create/atp_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def unzip_atp_wallet(wallet_file, location):
zis.close()
fis.close()

def fix_jsp_config(model, model_context):
def fix_jps_config(model, model_context):
#print model[model_constants.DOMAIN_INFO][model_constants.ATP_DB_INFO]
tns_admin = model[model_constants.DOMAIN_INFO][model_constants.RCU_DB_INFO][
model_constants.DRIVER_PARAMS_NET_TNS_ADMIN]
Expand Down Expand Up @@ -183,7 +183,7 @@ def is_regular_db(rcu_db_info):
return is_regular


def extract_walletzip(model, model_context, archive_file, atp_path):
def extract_walletzip(model, model_context, archive_file, atp_zipentry):
domain_parent = model_context.get_domain_parent_dir()
if domain_parent is None:
domain_path = model_context.get_domain_home()
Expand All @@ -193,7 +193,7 @@ def extract_walletzip(model, model_context, archive_file, atp_path):
extract_path = domain_path + os.sep + 'atpwallet'
extract_dir = File(extract_path)
extract_dir.mkdirs()
wallet_zip = archive_file.extractFile(atp_path, File(domain_path))
wallet_zip = archive_file.extractFile(atp_zipentry, File(domain_path))
unzip_atp_wallet(wallet_zip, extract_path)
os.remove(wallet_zip)
return extract_path
Expand Down