clone: Improve error message if block device can't be cloned.
This commit is contained in:
parent
2768270e43
commit
5e22e3bd6f
|
@ -794,10 +794,15 @@ def can_we_clone(conn, vol, path):
|
|||
if conn.is_remote() or not os.access(path, os.R_OK):
|
||||
msg = _("Connection does not support managed storage cloning.")
|
||||
else:
|
||||
is_dev = path.startswith("/dev")
|
||||
if conn.is_remote():
|
||||
msg = _("Cannot clone unmanaged remote storage.")
|
||||
elif not os.access(path, os.R_OK):
|
||||
msg = _("No write access to parent directory.")
|
||||
if is_dev:
|
||||
msg = _("Block devices to clone should be managed\n"
|
||||
"storage volumes.")
|
||||
else:
|
||||
msg = _("No write access to parent directory.")
|
||||
elif not os.path.exists(path):
|
||||
msg = _("Path does not exist.")
|
||||
|
||||
|
|
Loading…
Reference in New Issue