|
4 | 4 | """
|
5 | 5 | import copy
|
6 | 6 | import javaos as os
|
7 |
| -from sets import Set |
8 |
| - |
| 7 | +from java.io import ByteArrayOutputStream |
9 | 8 | from java.io import File
|
10 |
| -from java.io import IOException |
11 | 9 | from java.io import FileNotFoundException
|
12 |
| -from java.util.zip import ZipException |
| 10 | +from java.io import IOException |
| 11 | +from java.lang import IllegalStateException |
13 | 12 | from java.security import NoSuchAlgorithmException
|
14 | 13 | from java.util.jar import JarFile
|
15 |
| -from java.util.jar import Manifest |
16 |
| -from java.lang import IllegalStateException |
17 |
| -from java.io import ByteArrayOutputStream |
18 |
| - |
19 |
| -import oracle.weblogic.deploy.util.FileUtils as FileUtils |
20 |
| -import oracle.weblogic.deploy.util.PyOrderedDict as OrderedDict |
21 |
| - |
| 14 | +from java.util.zip import ZipException |
| 15 | +from sets import Set |
22 | 16 | from wlsdeploy.aliases.location_context import LocationContext
|
23 |
| -from wlsdeploy.aliases.wlst_modes import WlstModes |
24 |
| -from wlsdeploy.exception import exception_helper |
25 |
| -from wlsdeploy.tool.deploy import deployer_utils |
26 |
| -from wlsdeploy.tool.deploy.deployer import Deployer |
27 |
| -from wlsdeploy.util import dictionary_utils |
28 |
| -from wlsdeploy.util import string_utils |
29 |
| - |
30 | 17 | from wlsdeploy.aliases.model_constants import ABSOLUTE_SOURCE_PATH
|
31 |
| -from wlsdeploy.aliases.model_constants import APP_DEPLOYMENTS |
32 | 18 | from wlsdeploy.aliases.model_constants import APPLICATION
|
| 19 | +from wlsdeploy.aliases.model_constants import APP_DEPLOYMENTS |
33 | 20 | from wlsdeploy.aliases.model_constants import DEPLOYMENT_ORDER
|
34 | 21 | from wlsdeploy.aliases.model_constants import LIBRARY
|
35 | 22 | from wlsdeploy.aliases.model_constants import PARTITION
|
36 | 23 | from wlsdeploy.aliases.model_constants import PLAN_PATH
|
37 | 24 | from wlsdeploy.aliases.model_constants import PLAN_STAGE_MODE
|
| 25 | +from wlsdeploy.aliases.model_constants import RESOURCES |
38 | 26 | from wlsdeploy.aliases.model_constants import RESOURCE_GROUP
|
39 | 27 | from wlsdeploy.aliases.model_constants import RESOURCE_GROUP_TEMPLATE
|
40 |
| -from wlsdeploy.aliases.model_constants import RESOURCES |
41 | 28 | from wlsdeploy.aliases.model_constants import SECURITY_DD_MODEL
|
42 | 29 | from wlsdeploy.aliases.model_constants import SOURCE_PATH
|
43 | 30 | from wlsdeploy.aliases.model_constants import TARGET
|
44 | 31 | from wlsdeploy.aliases.model_constants import TARGETS
|
| 32 | +from wlsdeploy.aliases.wlst_modes import WlstModes |
| 33 | +from wlsdeploy.exception import exception_helper |
| 34 | +from wlsdeploy.tool.deploy import deployer_utils |
| 35 | +from wlsdeploy.tool.deploy.deployer import Deployer |
| 36 | +from wlsdeploy.util import dictionary_utils |
| 37 | +from wlsdeploy.util import string_utils |
| 38 | + |
| 39 | +import oracle.weblogic.deploy.util.FileUtils as FileUtils |
| 40 | +import oracle.weblogic.deploy.util.PyOrderedDict as OrderedDict |
45 | 41 |
|
46 | 42 |
|
47 | 43 | class ApplicationsDeployer(Deployer):
|
@@ -158,6 +154,27 @@ def __add_applications(self):
|
158 | 154 |
|
159 | 155 | application = \
|
160 | 156 | copy.deepcopy(dictionary_utils.get_dictionary_element(applications, application_name))
|
| 157 | + |
| 158 | + app_source_path = dictionary_utils.get_element(application, SOURCE_PATH) |
| 159 | + if string_utils.is_empty(app_source_path): |
| 160 | + ex = exception_helper.create_deploy_exception('WLSDPLY-09302', application_name, SOURCE_PATH) |
| 161 | + self.logger.throwing(ex, class_name=self._class_name, method_name=_method_name) |
| 162 | + raise ex |
| 163 | + |
| 164 | + if deployer_utils.is_path_into_archive(app_source_path): |
| 165 | + if self.archive_helper is not None: |
| 166 | + self.archive_helper.extract_file(app_source_path) |
| 167 | + else: |
| 168 | + ex = exception_helper.create_deploy_exception('WLSDPLY-09303', application_name) |
| 169 | + self.logger.throwing(ex, class_name=self._class_name, method_name=_method_name) |
| 170 | + raise ex |
| 171 | + full_source_path = File(File(self.model_context.get_domain_home()), app_source_path).getAbsolutePath() |
| 172 | + else: |
| 173 | + full_source_path = File(self.model_context.replace_token_string(app_source_path)).getAbsolutePath() |
| 174 | + |
| 175 | + application_name = \ |
| 176 | + self.__get_deployable_library_versioned_name(full_source_path, application_name) |
| 177 | + |
161 | 178 | quoted_application_name = self.wlst_helper.get_quoted_name_for_wlst(application_name)
|
162 | 179 | application_location.add_name_token(application_token, quoted_application_name)
|
163 | 180 |
|
@@ -732,9 +749,9 @@ def __deploy_app_online(self, application_name, source_path, targets, plan=None,
|
732 | 749 | self.logger.throwing(ex, class_name=self._class_name, method_name=_method_name)
|
733 | 750 | raise ex
|
734 | 751 |
|
735 |
| - if options is not None and 'libraryModule' in options and string_utils.to_boolean(options['libraryModule']): |
736 |
| - computed_name = self.__get_deployable_library_versioned_name(source_path, application_name) |
737 |
| - application_name = computed_name |
| 752 | + # if options is not None and 'libraryModule' in options and string_utils.to_boolean(options['libraryModule']): |
| 753 | + computed_name = self.__get_deployable_library_versioned_name(source_path, application_name) |
| 754 | + application_name = computed_name |
738 | 755 |
|
739 | 756 | # build the dictionary of named arguments to pass to the deploy_application method
|
740 | 757 | args = list()
|
|
0 commit comments