mirror of
https://github.com/clearml/clearml
synced 2025-06-23 01:55:38 +00:00
Improve error message when checking permissions
This commit is contained in:
parent
68cf2745ff
commit
21712a709d
@ -843,11 +843,16 @@ class StorageHelper(object):
|
|||||||
# do not check http/s connection permissions
|
# do not check http/s connection permissions
|
||||||
if dest_path.startswith('http'):
|
if dest_path.startswith('http'):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
err_msg = 'Insufficient permissions ({} failed) for ' + base_url
|
||||||
try:
|
try:
|
||||||
self.upload_from_stream(stream=six.BytesIO(b'clearml'), dest_path=dest_path)
|
self.upload_from_stream(stream=six.BytesIO(b'clearml'), dest_path=dest_path)
|
||||||
|
except Exception:
|
||||||
|
raise ValueError(err_msg.format("write"))
|
||||||
|
try:
|
||||||
self.delete(path=dest_path)
|
self.delete(path=dest_path)
|
||||||
except Exception:
|
except Exception:
|
||||||
raise ValueError('Insufficient permissions for {}'.format(base_url))
|
raise ValueError(err_msg.format("delete"))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user