Add Storage.outdated_volumes and Pool.is_outdated

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-06-16 20:01:51 +02:00
parent 0a471e719b
commit 3b441ebaad
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -161,6 +161,21 @@ class Storage(object):
volume)
self.vm.volumes[name] = volume
@property
def outdated_volumes(self):
''' Returns a list of outdated volumes '''
result = []
if self.vm.is_halted():
return result
volumes = self.vm.volumes
for volume in volumes.values():
pool = self.get_pool(volume)
if pool.is_outdated(volume):
result += [volume]
return result
def rename(self, old_name, new_name):
''' Notify the pools that the domain was renamed '''
volumes = self.vm.volumes
@ -257,6 +272,10 @@ class Pool(object):
raise NotImplementedError("Pool %s has destroy() not implemented" %
self.name)
def is_outdated(self, volume):
raise NotImplementedError("Pool %s has is_outdated() not implemented" %
self.name)
def remove(self, volume):
''' Remove volume'''
raise NotImplementedError("Pool %s has remove() not implemented" %