Skip to content

Commit c8e60d2

Browse files
authored
Issue #676 - Create domain home directory for archive extraction before create (#768)
1 parent aac160d commit c8e60d2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import weblogic.security.internal.SerializedSystemIni as SerializedSystemIni
77
import weblogic.security.internal.encryption.ClearOrEncryptedService as ClearOrEncryptedService
8+
from java.io import File
89
from java.io import FileOutputStream
910
from java.lang import IllegalArgumentException
1011
from java.util import Properties
@@ -234,14 +235,19 @@ def __extract_rcu_xml_file(self, xml_type, path):
234235
if path is not None:
235236
resolved_path = self.model_context.replace_token_string(path)
236237
if self.archive_helper is not None and self.archive_helper.contains_file(resolved_path):
238+
dir = File(self._domain_home)
239+
if (not dir.isDirectory()) and (not dir.mkdirs()):
240+
ex = exception_helper.create_create_exception('WLSDPLY-12259', self._domain_home, xml_type, path)
241+
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
242+
raise ex
237243
resolved_path = self.archive_helper.extract_file(resolved_path)
238244
try:
239245
resolved_file = FileUtils.validateFileName(resolved_path)
240246
result = resolved_file.getPath()
241247
except IllegalArgumentException, iae:
242248
ex = exception_helper.create_create_exception('WLSDPLY-12258', xml_type, path,
243249
iae.getLocalizedMessage(), error=iae)
244-
self.logger.throwing(ex, class_name=self._class_name, method_name=_method_name)
250+
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
245251
raise ex
246252

247253
self.logger.exiting(class_name=self.__class_name, method_name=_method_name, result=result)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,7 @@ WLSDPLY-12256=Attempting to target dynamic cluster {0} to multiple server groups
12721272
WLSDPLY-12257=No server group found for dynamic cluster {0}. Versions of WebLogic Server prior to 12.2.1.4 \
12731273
do not support targeting more than one server group to a dynamic cluster. Server group not defined in domain typedef
12741274
WLSDPLY-12258=RCU {0} file {1} is invalid : {2}
1275+
WLSDPLY-12259=Error creating directory {0} to extract RCU {1} file {2}
12751276

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

0 commit comments

Comments
 (0)