booby trap all the __eq__ methods

I am preeeetttty sure they are never used
This commit is contained in:
Michael Hudson-Doyle 2017-03-07 12:25:49 +13:00
parent dba60bbd1d
commit b38e4e57f7
2 changed files with 10 additions and 90 deletions

View File

@ -31,16 +31,7 @@ class DiskAction():
__hash__ = None
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self._action_id == other._action_id and
self.parent == other.parent and
self._ptable == other._ptable and
self._model == other._model and
self._serial == other._serial and
self._wipe == other._wipe and
self._type == other._type)
else:
return False
1/0
def get_parent(self):
return self.parent
@ -98,15 +89,7 @@ class RaidAction(DiskAction):
__hash__ = None
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self._action_id == other._action_id and
self.parent == other.parent and
self._raidlevel == other._raidlevel and
self._devices == other._devices and
self._spares == other._spares and
self._type == other._type)
else:
return False
1/0
def get(self):
action = {
@ -131,14 +114,7 @@ class LVMVolGroupAction(DiskAction):
__hash__ = None
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self._action_id == other._action_id and
self.parent == other.parent and
self._volgroup == other._volgroup and
self._devices == other._devices and
self._type == other._type)
else:
return False
1/0
def get(self):
action = {
@ -170,14 +146,7 @@ class LVMPartitionAction(DiskAction):
__hash__ = None
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self._action_id == other._action_id and
self.parent == other.parent and
self._lvmpartition == other._lvmpartition and
self._devices == other._devices and
self._type == other._type)
else:
return False
1/0
def get(self):
action = {
@ -215,16 +184,7 @@ class PartitionAction(DiskAction):
__hash__ = None
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self._action_id == other._action_id and
self.parent == other.parent and
self.partnum == other.partnum and
self._offset == other._offset and
self._size == other._size and
self.flags == other.flags and
self._type == other._type)
else:
return False
1/0
@property
def path(self):
@ -273,14 +233,7 @@ class BcacheAction(DiskAction):
return self._cache_device
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self._action_id == other._action_id and
self.parent == other.parent and
self.backing_device == other.backing_device and
self.cache_device == other.cache_device and
self._type == other._type)
else:
return False
1/0
def get(self):
return {
@ -304,13 +257,7 @@ class FormatAction(DiskAction):
__hash__ = None
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self._action_id == other._action_id and
self.parent == other.parent and
self._fstype == other._fstype and
self._type == other._type)
else:
return False
1/0
@property
def fstype(self):
@ -335,13 +282,7 @@ class MountAction(DiskAction):
__hash__ = None
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self._action_id == other._action_id and
self.parent == other.parent and
self._path == other._path and
self._type == other._type)
else:
return False
1/0
@property
def path(self):

View File

@ -49,22 +49,10 @@ class Disk():
self._partitions = OrderedDict()
def __eq__(self, other):
if isinstance(other, self.__class__):
print('disk same class, checking members')
return (self._devpath == other._devpath and
self._serial == other._serial and
self._parttype == other._parttype and
self._model == other._model and
self._size == other._size and
self._partitions == other._partitions)
else:
return False
1/0
__hash__ = None # declare we don't supply a hash
def __ne__(self, other):
return not self.__eq__(other)
def _get_size(self, devpath, size):
if size:
return size
@ -137,16 +125,7 @@ class Blockdev():
self.disk.parttype)
def __eq__(self, other):
if isinstance(other, self.__class__):
return (self.disk == other.disk and
self._filesystems == other._filesystems and
self._mounts == other._mounts and
self._mountactions == other._mountactions and
self.bcache == other.bcache and
self.lvm == other.lvm and
self.baseaction == other.baseaction)
else:
return False
1/0
__hash__ = None # declare we don't supply a hash