From: Jan Fajerski Date: Wed, 13 Feb 2019 11:35:05 +0000 (+0100) Subject: ceph-volume: make Device hashable to allow set of Device list in py3 X-Git-Tag: v14.1.0~70^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f872ab7b6f6bc9a1f97a0de909a0728b8f9c0a0c;p=ceph.git ceph-volume: make Device hashable to allow set of Device list in py3 Signed-off-by: Jan Fajerski --- diff --git a/src/ceph-volume/ceph_volume/util/device.py b/src/ceph-volume/ceph_volume/util/device.py index cb62a744fbf2..407bc420cdef 100644 --- a/src/ceph-volume/ceph_volume/util/device.py +++ b/src/ceph-volume/ceph_volume/util/device.py @@ -106,6 +106,9 @@ class Device(object): def __eq__(self, other): return self.path == other.path + def __hash__(self): + return hash(self.path) + def _parse(self): if not sys_info.devices: sys_info.devices = disk.get_devices()