]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume util.disk add as_int and as_float helpers for Size objects
authorAlfredo Deza <adeza@redhat.com>
Thu, 9 Aug 2018 18:22:55 +0000 (14:22 -0400)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 29 Aug 2018 18:31:57 +0000 (13:31 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit ff7054116c50cb149de207280b0469bf51655728)

src/ceph-volume/ceph_volume/util/disk.py

index fcefb28102ac1eac16c3b542ebe7139bcdbd6de3..053338972beea6d3bca415ee0652dd08833af16d 100644 (file)
@@ -331,6 +331,12 @@ class BaseFloatUnit(float):
             suffix=self.__class__.__name__.split('Float')[-1]
         )
 
+    def as_int(self):
+        return int(self.real)
+
+    def as_float(self):
+        return self.real
+
 
 class FloatB(BaseFloatUnit):
     pass