utils: RunCommandError: drop eq/ne support
We don't compare exceptions anywhere. Drop support for it as this
code would need to get more complicated with the next updates.
Bug: None
Test: unittests pass
Change-Id: I3e603119bc69aac98a72e005575b9777ce10806f
diff --git a/rh/utils.py b/rh/utils.py
index ded3e68..e6f8dc1 100644
--- a/rh/utils.py
+++ b/rh/utils.py
@@ -106,13 +106,6 @@
def __str__(self):
return self.stringify()
- def __eq__(self, other):
- return (isinstance(other, type(self)) and
- self.args == other.args)
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
class TerminateRunCommandError(RunCommandError):
"""We were signaled to shutdown while running a command.
diff --git a/rh/utils_unittest.py b/rh/utils_unittest.py
index aed007c..9cacb84 100755
--- a/rh/utils_unittest.py
+++ b/rh/utils_unittest.py
@@ -133,32 +133,6 @@
exception=Exception('bad'))
self.assertNotEqual('', repr(err))
- def test_eq(self):
- """Check object equality."""
- # Note: We explicitly do not use assertEqual here.
- # We also explicitly compare to ourselves to make sure our __eq__ works.
- # We also disable bad-option-value because this is a pylint3 warning.
- # pylint: disable=bad-option-value,comparison-with-itself
- err1 = rh.utils.RunCommandError('msg', self.result)
- self.assertTrue(err1 == err1)
- err2 = rh.utils.RunCommandError('msg', self.result)
- self.assertTrue(err1 == err2)
- err3 = rh.utils.RunCommandError('foo', self.result)
- self.assertFalse(err1 == err3)
-
- def test_ne(self):
- """Check object inequality."""
- # Note: We explicitly do not use assertNotEqual here.
- # We also explicitly compare to ourselves to make sure our __eq__ works.
- # We also disable bad-option-value because this is a pylint3 warning.
- # pylint: disable=bad-option-value,comparison-with-itself
- err1 = rh.utils.RunCommandError('msg', self.result)
- self.assertFalse(err1 != err1)
- err2 = rh.utils.RunCommandError('msg', self.result)
- self.assertFalse(err1 != err2)
- err3 = rh.utils.RunCommandError('foo', self.result)
- self.assertTrue(err1 != err3)
-
# We shouldn't require sudo to run unittests :).
@mock.patch.object(rh.utils, 'run')