Skip to content

Commit 04eed23

Browse files
committed
feat: support absolute path for dumpPath
1 parent 70f58a3 commit 04eed23

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

dynamodump/dynamodump.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,24 @@ def get_restore_table_matches(table_name_wildcard, separator):
343343
dir_list = os.listdir("./" + args.dumpPath)
344344
except OSError:
345345
logging.info(
346-
'Cannot find "./%s", Now trying current working directory..' % args.dumpPath
346+
'Cannot find "./%s", Now trying user provided absolute dump path..'
347+
% args.dumpPath
347348
)
348-
dump_data_path = CURRENT_WORKING_DIR
349349
try:
350-
dir_list = os.listdir(dump_data_path)
350+
dir_list = os.listdir(args.dumpPath)
351351
except OSError:
352352
logging.info(
353-
'Cannot find "%s" directory containing dump files!' % dump_data_path
353+
'Cannot find "%s", Now trying current working directory..'
354+
% args.dumpPath
354355
)
355-
sys.exit(1)
356+
dump_data_path = CURRENT_WORKING_DIR
357+
try:
358+
dir_list = os.listdir(dump_data_path)
359+
except OSError:
360+
logging.info(
361+
'Cannot find "%s" directory containing dump files!' % dump_data_path
362+
)
363+
sys.exit(1)
356364

357365
for dir_name in dir_list:
358366
if table_name_wildcard == "*":

0 commit comments

Comments
 (0)