]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume util.disk fix an issue where Disk objects would mutate on div operations
authorAlfredo Deza <adeza@redhat.com>
Mon, 10 Sep 2018 16:18:49 +0000 (12:18 -0400)
committerAlfredo Deza <adeza@redhat.com>
Thu, 13 Sep 2018 11:32:23 +0000 (07:32 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 7d1a3c74240e67621e993a304eaf566d4e2789d1)

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

index 053338972beea6d3bca415ee0652dd08833af16d..2cb6f7bc656ef8c259df87448053307344452652 100644 (file)
@@ -509,14 +509,14 @@ class Size(object):
     def __truediv__(self, other):
         if isinstance(other, Size):
             return self._b / other._b
-        self._b = self._b / other
-        return self
+        _b = self._b / other
+        return Size(b=_b)
 
     def __div__(self, other):
         if isinstance(other, Size):
             return self._b / other._b
-        self._b = self._b / other
-        return self
+        _b = self._b / other
+        return Size(b=_b)
 
     def __getattr__(self, unit):
         """