[master 1/1] Pickling support for Size.

vojtechtrefny installerbot-noreply at redhat.com
Wed Apr 8 07:02:11 UTC 2015


From: Vojtech Trefny <vtrefny at redhat.com>

Signed-off-by: Vojtech Trefny <vtrefny at redhat.com>
---
 blivet/size.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/blivet/size.py b/blivet/size.py
index 1300ce7..0a16845 100644
--- a/blivet/size.py
+++ b/blivet/size.py
@@ -269,6 +269,9 @@ def __repr__(self):
     def __deepcopy__(self, memo):
         return Size(self.convertTo())
 
+    def __reduce__(self):
+        return (self.__class__, (str(self.convertTo()),))
+
     def __add__(self, other, context=None):
         return Size(Decimal.__add__(self, other, context=context))
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/3a36bfd2e074deceb33554afbda45e9c5f51875d


More information about the anaconda-patches mailing list