From: Vratislav Podzimek <vpodzime(a)redhat.com>
Instead of passing cache parameters as separate numbers, strings, etc. we may
better put them into objects that hold them as a single logical unit.
---
blivet/devices/cache.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/blivet/devices/cache.py b/blivet/devices/cache.py
index f036466..17da72c 100644
--- a/blivet/devices/cache.py
+++ b/blivet/devices/cache.py
@@ -114,3 +114,24 @@ def hits(self):
def misses(self):
"""number of misses"""
pass
+
+(a)add_metaclass(abc.ABCMeta)
+class CacheRequest(object):
+ """Abstract base class for cache requests specifying cache parameters
for a
+ cached device
+
+ """
+ @abc.abstractproperty
+ def size(self):
+ """Requested size"""
+ pass
+
+ @abc.abstractproperty
+ def fast_devs_names(self):
+ """Names of the devices (type-specific) to allocate/create the
cache on"""
+ pass
+
+ @abc.abstractproperty
+ def mode(self):
+ """Mode the cache should use"""
+ pass
--
To view this commit on github, visit
https://github.com/rhinstaller/blivet/commit/9026f941ecfbfe7998ed3d63214a...