Skip to content

Commit

Permalink
Merge pull request ceph#26401 from jan--f/c-v-fix-siez-format-py3
Browse files Browse the repository at this point in the history
ceph-volume: implement __format__ in Size to format sizes in py3

Reviewed-by: Andrew Schoen <[email protected]>
  • Loading branch information
andrewschoen authored Feb 18, 2019
2 parents 438bc64 + 7a741f2 commit eb1caff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ceph-volume/ceph_volume/util/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ def __repr__(self):
def __str__(self):
return "%s" % self._get_best_format()

def __format__(self, spec):
return str(self._get_best_format()).__format__(spec)

def __lt__(self, other):
return self._b < other._b

Expand Down

0 comments on commit eb1caff

Please sign in to comment.