projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into 2895-no-more-redis
[arvados.git]
/
sdk
/
python
/
arvados
/
commands
/
put.py
diff --git
a/sdk/python/arvados/commands/put.py
b/sdk/python/arvados/commands/put.py
index 255021e7755ba93eaa0f2fbcfe3c3b69c57309eb..01bae2feade3e7345c1e57c352eba713cafe4a81 100644
(file)
--- a/
sdk/python/arvados/commands/put.py
+++ b/
sdk/python/arvados/commands/put.py
@@
-329,7
+329,6
@@
def exit_signal_handler(sigcode, frame):
sys.exit(-sigcode)
def main(arguments=None):
sys.exit(-sigcode)
def main(arguments=None):
- ResumeCache.setup_user_cache()
args = parse_arguments(arguments)
if args.progress:
args = parse_arguments(arguments)
if args.progress:
@@
-338,17
+337,23
@@
def main(arguments=None):
reporter = progress_writer(machine_progress)
else:
reporter = None
reporter = progress_writer(machine_progress)
else:
reporter = None
+ bytes_expected = expected_bytes_for(args.paths)
try:
try:
+ ResumeCache.setup_user_cache()
resume_cache = ResumeCache(ResumeCache.make_path(args))
resume_cache = ResumeCache(ResumeCache.make_path(args))
- if not args.resume:
- resume_cache.restart()
+ except (IOError, OSError):
+ # Couldn't open cache directory/file. Continue without it.
+ resume_cache = None
+ writer = ArvPutCollectionWriter(resume_cache, reporter, bytes_expected)
except ResumeCacheConflict:
print "arv-put: Another process is already uploading this data."
sys.exit(1)
except ResumeCacheConflict:
print "arv-put: Another process is already uploading this data."
sys.exit(1)
-
- writer = ArvPutCollectionWriter.from_cache(
- resume_cache, reporter, expected_bytes_for(args.paths))
+ else:
+ if not args.resume:
+ resume_cache.restart()
+ writer = ArvPutCollectionWriter.from_cache(
+ resume_cache, reporter, bytes_expected)
# Install our signal handler for each code in CAUGHT_SIGNALS, and save
# the originals.
# Install our signal handler for each code in CAUGHT_SIGNALS, and save
# the originals.
@@
-393,7
+398,8
@@
def main(arguments=None):
for sigcode, orig_handler in orig_signal_handlers.items():
signal.signal(sigcode, orig_handler)
for sigcode, orig_handler in orig_signal_handlers.items():
signal.signal(sigcode, orig_handler)
- resume_cache.destroy()
+ if resume_cache is not None:
+ resume_cache.destroy()
if __name__ == '__main__':
main()
if __name__ == '__main__':
main()