Closed as not planned
Description
While trying to restore with --srcTable "*"
I ran into
INFO:root:Starting restore for .gitkeep to .gitkeep..
Exception in thread Thread-4 (do_restore):
Traceback (most recent call last):
File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/bin/dynamodump", line 866, in do_restore
open(dump_data_path + os.sep + source_table + os.sep + SCHEMA_FILE)
NotADirectoryError: [Errno 20] Not a directory: '/dump/.gitkeep/schema.json'
It would be nice if only directories were considered when looping over the matching content in the dump path.
IIUC, a simple
if os.is_dir(dir_name):
continue
after line 379 in dynamodump.py
should do the trick.
In my case I want to add an empty "scratch" directory to git
, hence the .gitkeep
file, but I can image that people want to put a README.md
or similar in the dump path for documentation purposes.