b6e9cf
From 32d8b8ef61a3786ff409bdba7f74ab53987f04c1 Mon Sep 17 00:00:00 2001
b6e9cf
From: Andy Grover <agrover@redhat.com>
b6e9cf
Date: Wed, 28 Oct 2015 09:28:29 -0700
b6e9cf
Subject: [PATCH] Fix comparisons to None
b6e9cf
b6e9cf
see https://bugzilla.redhat.com/show_bug.cgi?id=1276044
b6e9cf
b6e9cf
Signed-off-by: Andy Grover <agrover@redhat.com>
b6e9cf
---
b6e9cf
 rtslib/node.py | 4 ++--
b6e9cf
 1 file changed, 2 insertions(+), 2 deletions(-)
b6e9cf
b6e9cf
diff --git a/rtslib/node.py b/rtslib/node.py
b6e9cf
index c319a5b..e61249d 100644
b6e9cf
--- a/rtslib/node.py
b6e9cf
+++ b/rtslib/node.py
b6e9cf
@@ -34,10 +34,10 @@ class CFSNode(object):
b6e9cf
         self._path = self.configfs_dir
b6e9cf
 
b6e9cf
     def __eq__(self, other):
b6e9cf
-        return self._path == other._path
b6e9cf
+        return isinstance(other, self.__class__) and self._path == other._path
b6e9cf
 
b6e9cf
     def __ne__(self, other):
b6e9cf
-        return self._path != other._path
b6e9cf
+        return not self.__eq__(other)
b6e9cf
 
b6e9cf
     def _get_path(self):
b6e9cf
         return self._path