17800: Fixes bug.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Mon, 14 Jun 2021 14:01:36 +0000 (11:01 -0300)
committerPeter Amstutz <peter.amstutz@curii.com>
Wed, 7 Jul 2021 21:30:13 +0000 (17:30 -0400)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

sdk/python/arvados/commands/put.py

index 9596a2dc2d26efcddebbd7921e32ff38ebdb7352..bc07c8695a5c8d7de5310104d1d8c2325a9da231 100644 (file)
@@ -259,9 +259,8 @@ def parse_arguments(arguments):
 
     args.paths = ["-" if x == "/dev/stdin" else x for x in args.paths]
 
-    if len(args.paths) != 1 or os.path.isdir(args.paths[0]):
-        if args.filename:
-            arg_parser.error("""
+    if args.filename and (len(args.paths) != 1 or os.path.isdir(args.paths[0])):
+        arg_parser.error("""
     --filename argument cannot be used when storing a directory or
     multiple files.
     """)
@@ -525,6 +524,8 @@ class ArvPutUploadJob(object):
                 self._write_stdin(self.filename or 'stdin')
             elif not os.path.exists(path):
                  raise PathDoesNotExistError(u"file or directory '{}' does not exist.".format(path))
+            elif (not self.follow_links) and os.path.islink(path):
+                continue
             elif os.path.isdir(path):
                 # Use absolute paths on cache index so CWD doesn't interfere
                 # with the caching logic.