Add Storage.outdated_volumes and Pool.is_outdated
This commit is contained in:
parent
0a471e719b
commit
3b441ebaad
@ -161,6 +161,21 @@ class Storage(object):
|
|||||||
volume)
|
volume)
|
||||||
self.vm.volumes[name] = 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):
|
def rename(self, old_name, new_name):
|
||||||
''' Notify the pools that the domain was renamed '''
|
''' Notify the pools that the domain was renamed '''
|
||||||
volumes = self.vm.volumes
|
volumes = self.vm.volumes
|
||||||
@ -257,6 +272,10 @@ class Pool(object):
|
|||||||
raise NotImplementedError("Pool %s has destroy() not implemented" %
|
raise NotImplementedError("Pool %s has destroy() not implemented" %
|
||||||
self.name)
|
self.name)
|
||||||
|
|
||||||
|
def is_outdated(self, volume):
|
||||||
|
raise NotImplementedError("Pool %s has is_outdated() not implemented" %
|
||||||
|
self.name)
|
||||||
|
|
||||||
def remove(self, volume):
|
def remove(self, volume):
|
||||||
''' Remove volume'''
|
''' Remove volume'''
|
||||||
raise NotImplementedError("Pool %s has remove() not implemented" %
|
raise NotImplementedError("Pool %s has remove() not implemented" %
|
||||||
|
Loading…
Reference in New Issue
Block a user