When a storage volume is created, its 'used_by' field should be set to
empty. However, some functions don't set that field.
Set the field 'used_by' to [] when creating a storage volume by
'url' or 'file'.
Signed-off-by: CrÃstian Deives <cristiandeives(a)gmail.com>
---
src/kimchi/model/storagevolumes.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index ab032e3..9165946 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -239,6 +239,11 @@ class StorageVolumesModel(object):
finally:
os.remove(file_path)
+ vol_info = StorageVolumeModel(conn=self.conn,
+ objstore=self.objstore).lookup(pool_name,
+ name)
+ set_disk_used_by(self.objstore, vol_info['path'], [])
+
cb('OK', True)
def get_list(self, pool_name):
--
2.4.1