From: Alfredo Deza Date: Mon, 10 Sep 2018 16:18:49 +0000 (-0400) Subject: ceph-volume util.disk fix an issue where Disk objects would mutate on div operations X-Git-Tag: v14.0.1~344^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7d1a3c74240e67621e993a304eaf566d4e2789d1;p=ceph-ci.git ceph-volume util.disk fix an issue where Disk objects would mutate on div operations Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/util/disk.py b/src/ceph-volume/ceph_volume/util/disk.py index 053338972be..2cb6f7bc656 100644 --- a/src/ceph-volume/ceph_volume/util/disk.py +++ b/src/ceph-volume/ceph_volume/util/disk.py @@ -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): """