diff options
author | Pavel Hrdina <phrdina@redhat.com> | 2017-03-06 09:28:50 +0100 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2017-03-06 14:31:42 -0500 |
commit | 79baf8e30c953cc155dd5bebba713105bc566db1 (patch) | |
tree | 33e695732e3ac02e97c8d200f6b4159b8bbe496c /virtManager/clone.py | |
parent | d93203022ac66bb35ed39715a06e9615b07a2e76 (diff) | |
download | virt-manager-79baf8e30c953cc155dd5bebba713105bc566db1.tar.gz |
virtManager.clone: don't generate clone path if we don't default to clone
If we don't default to clone the disk in question don't try to generate
and assign default clone_path, this will force user to select the path
explicitly and avoid some unnecessary errors in debug log.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Diffstat (limited to 'virtManager/clone.py')
-rw-r--r-- | virtManager/clone.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/virtManager/clone.py b/virtManager/clone.py index 0704b21a..0fa74e6f 100644 --- a/virtManager/clone.py +++ b/virtManager/clone.py @@ -407,6 +407,13 @@ class vmmCloneVM(vmmGObjectUI): storage_add(cloneinfo) continue + storage_row[STORAGE_INFO_CAN_CLONE] = True + + # If we cannot create default clone_path don't even try to do that + if not default: + storage_add() + continue + try: # Generate disk path, make sure that works clone_path = self.generate_clone_path_name(path) @@ -421,7 +428,6 @@ class vmmCloneVM(vmmGObjectUI): clone_path) storage_add(str(e)) - storage_row[STORAGE_INFO_CAN_CLONE] = True storage_row[STORAGE_INFO_NEW_PATH] = clone_path storage_row[STORAGE_INFO_SIZE] = self.pretty_storage(size) storage_add() |