]> git.apps.os.sepia.ceph.com Git - teuthology.git/commit
task.internal.archive: fix 'Permission denied' error 1444/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 10 Apr 2020 15:19:18 +0000 (17:19 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Fri, 10 Apr 2020 17:47:11 +0000 (19:47 +0200)
commit6d1cfc09371fdde3130d36eaf21154b08d34a1a7
tree04ad64aa2a15c1b87e23fff0be0d92e6af9057d2
parent37546b34f422e3f54434c80727564f510faaf60e
task.internal.archive: fix 'Permission denied' error

This fix address failure like:

```
2020-04-10T10:35:13.508 ERROR:teuthology.run_tasks:Manager failed: internal.archive
Traceback (most recent call last):
  File "/home/worker/src/teuthology_master/teuthology/run_tasks.py", line 167, in run_tasks
    suppress = manager.__exit__(*exc_info)
  File "/usr/lib64/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/home/worker/src/teuthology_master/teuthology/task/internal/__init__.py", line 363, in archive
    fetch_binaries_for_coredumps(path, rem)
  File "/home/worker/src/teuthology_master/teuthology/task/internal/__init__.py", line 318, in fetch_binaries_for_coredumps
    dump_program))
  File "/home/worker/src/teuthology_master/teuthology/orchestra/remote.py", line 325, in _sftp_get_file
    sftp.get(remote_path, local_path)
  File "/home/worker/src/teuthology_master/virtualenv/lib/python2.7/site-packages/paramiko/sftp_client.py", line 801, in get
    with open(localpath, "wb") as fl:
IOError: [Errno 13] Permission denied: '/usr/bin/python3'
```

The issue happens because of os.path.join ignores all prior arguments
if the next has '/' prefix (i.e. absolute), for example:

```
>>> os.path.join('a/b/', '/x/y')
'/x/y'
```

when a user expect to get 'a/b/x/y', she gets '/x/y'.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
teuthology/task/internal/__init__.py