Skip to content

Commit

Permalink
ceph-volume util.disk fix an issue where Disk objects would mutate on…
Browse files Browse the repository at this point in the history
… div operations

Signed-off-by: Alfredo Deza <adeza@redhat.com>
  • Loading branch information
Alfredo Deza committed Sep 10, 2018
1 parent 860068e commit 7d1a3c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ceph-volume/ceph_volume/util/disk.py
Expand Up @@ -509,14 +509,14 @@ def __mul__(self, other):
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):
"""
Expand Down

0 comments on commit 7d1a3c7

Please sign in to comment.