Skip to content

Commit ba1837f

Browse files
CarolynRountreeddsharpe
authored andcommitted
Issue#474 throw exception if directory for archive file does not exist (#502)
1 parent 31e2394 commit ba1837f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

core/src/main/python/discover.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from wlsdeploy.tool.validate.validator import Validator
4545
from wlsdeploy.util import getcreds
4646
from wlsdeploy.util import model_translator
47+
from wlsdeploy.util import path_utils
4748
from wlsdeploy.util import tool_exit
4849
from wlsdeploy.util import wlst_extended
4950
from wlsdeploy.util import wlst_helper
@@ -159,6 +160,11 @@ def __process_archive_filename_arg(required_arg_map):
159160
_method_name = '__process_archive_filename_arg'
160161

161162
archive_file_name = required_arg_map[CommandLineArgUtil.ARCHIVE_FILE_SWITCH]
163+
archive_dir_name = path_utils.get_parent_directory(archive_file_name)
164+
if os.path.exists(archive_dir_name) is False:
165+
ex = exception_helper.create_cla_exception('WLSDPLY-06026', archive_file_name)
166+
__logger.throwing(ex, class_name=_class_name, method_name=_method_name)
167+
raise ex
162168
try:
163169
archive_file = WLSDeployArchive(archive_file_name)
164170
except (IllegalArgumentException, IllegalStateException), ie:

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
@@ -475,6 +475,7 @@ WLSDPLY-06023=No domain name found in the domain configuration
475475
WLSDPLY-06024=No variable file provided. Model passwords will contain the token '-- FIX ME --'
476476
WLSDPLY-06025=Variable file was provided. Model password attributes will be replaced with tokens and corresponding \
477477
values put into the variable file.
478+
WLSDPLY-06026=Target directory for archive file argument {0} does not exist
478479

479480
# discoverer.py
480481
WLSDPLY-06100=Find attributes at location {0}

0 commit comments

Comments
 (0)