Skip to content

Commit

Permalink
Fix pylint error in ipapython/dn.py
Browse files Browse the repository at this point in the history
ipapython/dn.py:1324: [R1710(inconsistent-return-statements), DN.__contains__]
Either all return statements in a function should return an expression, or none of them should.)

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
  • Loading branch information
tiran committed Jan 23, 2018
1 parent b2bafe8 commit ec60db3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ipapython/dn.py
Expand Up @@ -1320,9 +1320,11 @@ def _tailmatch(self, pattern, start, end, direction):
return not self._cmp_sequence(pattern, start, pat_len)
return 0


def __contains__(self, other):
'Return the outcome of the test other in self. Note the reversed operands.'
"""Return the outcome of the test other in self.
Note the reversed operands.
"""

if isinstance(other, RDN):
other = DN(other)
Expand All @@ -1336,9 +1338,9 @@ def __contains__(self, other):
return True
i += 1
return False
else:
raise TypeError("expected DN or RDN but got %s" % (other.__class__.__name__))

raise TypeError(
"expected DN or RDN but got %s" % other.__class__.__name__
)

def find(self, pattern, start=None, end=None):
'''
Expand Down

0 comments on commit ec60db3

Please sign in to comment.