Skip to content

Commit 6f85c12

Browse files
Merge branch 'master' into WDT-267-Server-Migratable-Target-Attribute-fixes
2 parents d1f2f51 + b328532 commit 6f85c12

File tree

8 files changed

+99
-51
lines changed

8 files changed

+99
-51
lines changed

core/src/main/java/oracle/weblogic/deploy/util/WLSDeployArchive.java

Lines changed: 3 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
package oracle.weblogic.deploy.util;
@@ -657,7 +657,7 @@ public List<String> listDomainLibLibraries() throws WLSDeployArchiveIOException
657657
/**
658658
* Extract the specified domain library to the specified location (e.g., $DOMAIN_HOME/lib).
659659
*
660-
* @param archivePath the name of the JAR to extract
660+
* @param archivePath the path of the library within the archive
661661
* @param extractToLocation the location to write the file
662662
* @throws WLSDeployArchiveIOException if an IOException occurred while extracting or writing the file
663663
* @throws IllegalArgumentException if the file or directory passed in does not exist
@@ -669,11 +669,7 @@ public void extractDomainLibLibrary(String archivePath, File extractToLocation)
669669
validateNonEmptyString(archivePath, "archivePath", METHOD);
670670
validateExistingDirectory(extractToLocation, "extractToLocation", getArchiveFileName(), METHOD);
671671

672-
String libPath = archivePath;
673-
if (!archivePath.startsWith(ARCHIVE_DOMLIB_TARGET_DIR)) {
674-
libPath = ARCHIVE_DOMLIB_TARGET_DIR + ZIP_SEP + archivePath;
675-
}
676-
extractFileFromZip(libPath, ARCHIVE_DOMLIB_TARGET_DIR, "", extractToLocation);
672+
extractFileFromZip(archivePath, ARCHIVE_DOMLIB_TARGET_DIR, "", extractToLocation);
677673
LOGGER.exiting(CLASS, METHOD);
678674
}
679675

core/src/main/java/oracle/weblogic/deploy/util/WLSDeployZipFile.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,14 @@ private void saveChangesToZip(Map<String, ZipEntry> updatedZipEntries, Map<Strin
775775
private File getNewOutputFile() throws WLSDeployArchiveIOException {
776776
final String METHOD = "getNewOutputFile";
777777

778-
String[] nameComponents = FileUtils.parseFileName(getFileName());
778+
String fileName = getFileName();
779+
if (fileName.contains(File.separator)) {
780+
int lastSeparator = fileName.lastIndexOf(File.separator);
781+
if (lastSeparator > 0)
782+
fileName = fileName.substring(lastSeparator+1);
783+
}
784+
785+
String[] nameComponents = FileUtils.parseFileName(fileName);
779786

780787
File directory = getFile().getParentFile();
781788
File newOutputFile;

core/src/main/python/create.py

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -335,41 +335,42 @@ def validate_model(model_dictionary, model_context, aliases):
335335
def validateRCUArgsAndModel(model_context, model):
336336
has_atpdbinfo = 0
337337
domain_info = model[model_constants.DOMAIN_INFO]
338-
if model_constants.RCU_DB_INFO in domain_info:
339-
rcu_db_info = domain_info[model_constants.RCU_DB_INFO]
340-
has_tns_admin = atp_helper.has_tns_admin(rcu_db_info)
341-
has_regular_db = atp_helper.is_regular_db(rcu_db_info)
342-
has_atpdbinfo = atp_helper.has_atpdbinfo(rcu_db_info)
343-
344-
if model_context.get_archive_file_name() and not has_regular_db:
345-
System.setProperty('oracle.jdbc.fanEnabled', 'false')
346-
347-
# 1. If it does not have the oracle.net.tns_admin specified, then extract to domain/atpwallet
348-
# 2. If it is plain old regular oracle db, do nothing
349-
# 3. If it deos not have tns_admin in the model, then the wallet must be in the archive
350-
if not has_tns_admin:
351-
# extract the wallet first
352-
archive_file = WLSDeployArchive(model_context.get_archive_file_name())
353-
atp_wallet_zipentry = archive_file.getATPWallet()
354-
if atp_wallet_zipentry and model[model_constants.TOPOLOGY]['Name']:
355-
extract_path = atp_helper.extract_walletzip(model, model_context, archive_file, atp_wallet_zipentry)
356-
# update the model to add the tns_admin
357-
model[model_constants.DOMAIN_INFO][model_constants.RCU_DB_INFO][
358-
model_constants.DRIVER_PARAMS_NET_TNS_ADMIN] = extract_path
359-
else:
360-
__logger.severe('WLSDPLY-12411', error=None,
361-
class_name=_class_name, method_name="validateRCUArgsAndModel")
338+
if domain_info is not None:
339+
if model_constants.RCU_DB_INFO in domain_info:
340+
rcu_db_info = domain_info[model_constants.RCU_DB_INFO]
341+
has_tns_admin = atp_helper.has_tns_admin(rcu_db_info)
342+
has_regular_db = atp_helper.is_regular_db(rcu_db_info)
343+
has_atpdbinfo = atp_helper.has_atpdbinfo(rcu_db_info)
344+
345+
if model_context.get_archive_file_name() and not has_regular_db:
346+
System.setProperty('oracle.jdbc.fanEnabled', 'false')
347+
348+
# 1. If it does not have the oracle.net.tns_admin specified, then extract to domain/atpwallet
349+
# 2. If it is plain old regular oracle db, do nothing
350+
# 3. If it deos not have tns_admin in the model, then the wallet must be in the archive
351+
if not has_tns_admin:
352+
# extract the wallet first
353+
archive_file = WLSDeployArchive(model_context.get_archive_file_name())
354+
atp_wallet_zipentry = archive_file.getATPWallet()
355+
if atp_wallet_zipentry and model[model_constants.TOPOLOGY]['Name']:
356+
extract_path = atp_helper.extract_walletzip(model, model_context, archive_file, atp_wallet_zipentry)
357+
# update the model to add the tns_admin
358+
model[model_constants.DOMAIN_INFO][model_constants.RCU_DB_INFO][
359+
model_constants.DRIVER_PARAMS_NET_TNS_ADMIN] = extract_path
360+
else:
361+
__logger.severe('WLSDPLY-12411', error=None,
362+
class_name=_class_name, method_name="validateRCUArgsAndModel")
363+
__clean_up_temp_files()
364+
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
365+
366+
else:
367+
if model_context.get_domain_typedef().required_rcu():
368+
if not model_context.get_rcu_database() or not model_context.get_rcu_prefix():
369+
__logger.severe('WLSDPLY-12408', model_context.get_domain_type(), CommandLineArgUtil.RCU_DB_SWITCH,
370+
CommandLineArgUtil.RCU_PREFIX_SWITCH)
362371
__clean_up_temp_files()
363372
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
364373

365-
else:
366-
if model_context.get_domain_typedef().required_rcu():
367-
if not model_context.get_rcu_database() or not model_context.get_rcu_prefix():
368-
__logger.severe('WLSDPLY-12408', model_context.get_domain_type(), CommandLineArgUtil.RCU_DB_SWITCH,
369-
CommandLineArgUtil.RCU_PREFIX_SWITCH)
370-
__clean_up_temp_files()
371-
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
372-
373374
return has_atpdbinfo
374375

375376

@@ -388,6 +389,8 @@ def main(args):
388389

389390
wlst_helper.silence()
390391

392+
exit_code = CommandLineArgUtil.PROG_OK_EXIT_CODE
393+
391394
try:
392395
model_context = __process_args(args)
393396
except CLAException, ex:
@@ -450,8 +453,11 @@ def main(args):
450453
tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE)
451454

452455
__clean_up_temp_files()
456+
457+
tool_exit.end(model_context, exit_code)
453458
return
454459

460+
455461
if __name__ == "main":
456462
WebLogicDeployToolingVersion.logVersionInfo(_program_name)
457463
main(sys.argv)

core/src/main/python/wlsdeploy/tool/util/library_helper.py

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
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
"""
5-
6-
import wlsdeploy.util.dictionary_utils as dictionary_utils
5+
from java.io import File
6+
from oracle.weblogic.deploy.util import WLSDeployArchive
7+
from shutil import copy
78

89
from wlsdeploy.aliases.model_constants import DOMAIN_LIBRARIES
9-
from wlsdeploy.aliases.model_constants import RCU_DB_INFO
1010
from wlsdeploy.exception import exception_helper
1111
from wlsdeploy.tool.util.alias_helper import AliasHelper
1212
from wlsdeploy.tool.util.archive_helper import ArchiveHelper
1313
from wlsdeploy.tool.util.wlst_helper import WlstHelper
1414

15+
import wlsdeploy.util.dictionary_utils as dictionary_utils
16+
1517

1618
class LibraryHelper(object):
1719
"""
@@ -51,9 +53,14 @@ def install_domain_libraries(self):
5153
raise ex
5254

5355
for domain_lib in domain_libs:
54-
self.logger.info('WLSDPLY-12215', domain_lib, self.domain_home,
55-
class_name=self.__class_name, method_name=_method_name)
56-
self.archive_helper.extract_domain_library(domain_lib)
56+
if WLSDeployArchive.isPathIntoArchive(domain_lib):
57+
self.logger.info('WLSDPLY-12215', domain_lib, self.domain_home,
58+
class_name=self.__class_name, method_name=_method_name)
59+
self.archive_helper.extract_domain_library(domain_lib)
60+
else:
61+
self.logger.info('WLSDPLY-12235', domain_lib, self.domain_home,
62+
class_name=self.__class_name, method_name=_method_name)
63+
self._copy_domain_library(domain_lib)
5764

5865
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
5966
return
@@ -78,3 +85,20 @@ def extract_classpath_libraries(self):
7885
class_name=self.__class_name, method_name=_method_name)
7986
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
8087
return
88+
89+
def _copy_domain_library(self, domain_lib):
90+
"""
91+
Copy the specified domain library to the domain's lib directory.
92+
:raises: BundleAwareException of the specified type: if an error occurs
93+
"""
94+
_method_name = '_copy_domain_library'
95+
96+
source_path = File(domain_lib).getAbsolutePath()
97+
target_dir = File(self.domain_home, 'lib').getPath()
98+
99+
try:
100+
copy(str(source_path), str(target_dir))
101+
except IOError:
102+
ex = exception_helper.create_create_exception('WLSDPLY-12234', source_path, target_dir)
103+
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
104+
raise ex

core/src/main/python/wlsdeploy/tool/validate/validator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,10 @@ def __validate_path_tokens_attribute(self, attribute_name, attribute_value, mode
889889
elif value_data_type == 'string':
890890
attr_values.append(attribute_value)
891891

892+
else:
893+
# must be a list
894+
attr_values.extend(attribute_value)
895+
892896
for item_path in attr_values:
893897
validation_result = self.__validate_single_path_in_archive(item_path.strip(), attribute_name,
894898
model_folder_path, validation_result)

core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,8 @@ WLSDPLY-12230=Creating placeholder for Coherence cluster {0}
10231023
WLSDPLY-12231=Apply Domain {0} domain level attributes
10241024
WLSDPLY-12232=Unable to configure the SecurityConfiguration in domain release {0} using weblogic-deploy {1}
10251025
WLSDPLY-12233=Target JRF deployments and resources to {0} {1}
1026+
WLSDPLY-12234=Unable to copy domain library {0} to directory {1}
1027+
WLSDPLY-12235=Installing domain library {0} to lib directory of {1}
10261028

10271029
# domain_typedef.py
10281030
WLSDPLY-12300={0} got the domain type {1} but the domain type definition file {2} was not valid: {3}

installer/src/main/bin/createDomain.cmd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@rem **************************************************************************
33
@rem createDomain.cmd
44
@rem
5-
@rem Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
5+
@rem Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
66
@rem The Universal Permissive License (UPL), Version 1.0
77
@rem
88
@rem NAME
@@ -271,7 +271,8 @@ IF NOT EXIST "%WLST%" (
271271
)
272272
:found_wlst
273273

274-
SET LOG_CONFIG_CLASS=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig
274+
SET LOG_CONFIG_CLASS=oracle.weblogic.deploy.logging.WLSDeployCustomizeLoggingConfig
275+
SET WLSDEPLOY_LOG_HANDLER=oracle.weblogic.deploy.logging.SummaryHandler
275276
SET WLST_PROPERTIES=-Dcom.oracle.cie.script.throwException=true
276277
SET "WLST_PROPERTIES=-Djava.util.logging.config.class=%LOG_CONFIG_CLASS% %WLST_PROPERTIES%"
277278
SET "WLST_PROPERTIES=%WLST_PROPERTIES% %WLSDEPLOY_PROPERTIES%"
@@ -282,6 +283,9 @@ IF NOT DEFINED WLSDEPLOY_LOG_PROPERTIES (
282283
IF NOT DEFINED WLSDEPLOY_LOG_DIRECTORY (
283284
SET WLSDEPLOY_LOG_DIRECTORY=%WLSDEPLOY_HOME%\logs
284285
)
286+
IF NOT DEFINED WLSDEPLOY_LOG_HANDLERS (
287+
SET WLSDEPLOY_LOG_HANDLERS=%WLSDEPLOY_LOG_HANDLER%
288+
)
285289

286290
ECHO JAVA_HOME = %JAVA_HOME%
287291
ECHO WLST_EXT_CLASSPATH = %WLST_EXT_CLASSPATH%

installer/src/main/bin/createDomain.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# *****************************************************************************
33
# createDomain.sh
44
#
5-
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
5+
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
66
# The Universal Permissive License (UPL), Version 1.0
77
#
88
# NAME
@@ -295,7 +295,8 @@ else
295295
fi
296296
fi
297297

298-
LOG_CONFIG_CLASS=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig
298+
LOG_CONFIG_CLASS=oracle.weblogic.deploy.logging.WLSDeployCustomizeLoggingConfig
299+
WLSDEPLOY_LOG_HANDLER=oracle.weblogic.deploy.logging.SummaryHandler
299300
WLST_PROPERTIES=-Dcom.oracle.cie.script.throwException=true
300301
WLST_PROPERTIES="-Djava.util.logging.config.class=${LOG_CONFIG_CLASS} ${WLST_PROPERTIES} ${WLSDEPLOY_PROPERTIES}"
301302
export WLST_PROPERTIES
@@ -308,6 +309,10 @@ if [ "${WLSDEPLOY_LOG_DIRECTORY}" = "" ]; then
308309
WLSDEPLOY_LOG_DIRECTORY=${WLSDEPLOY_HOME}/logs; export WLSDEPLOY_LOG_DIRECTORY
309310
fi
310311

312+
if [ "${WLSDEPLOY_LOG_HANDLERS}" == "" ]; then
313+
WLSDEPLOY_LOG_HANDLERS=${WLSDEPLOY_LOG_HANDLER}; export WLSDEPLOY_LOG_HANDLERS
314+
fi
315+
311316
echo "JAVA_HOME = ${JAVA_HOME}"
312317
echo "WLST_EXT_CLASSPATH = ${WLST_EXT_CLASSPATH}"
313318
echo "CLASSPATH = ${CLASSPATH}"

0 commit comments

Comments
 (0)