]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix pylint issue with type VS isinstance in event_observers
authorAssaf Muller <amuller@redhat.com>
Wed, 11 Mar 2015 15:45:00 +0000 (11:45 -0400)
committerAssaf Muller <amuller@redhat.com>
Wed, 11 Mar 2015 15:45:00 +0000 (11:45 -0400)
New version of pylint started complaining about the unpythonic
usage of type. This patch fixes the issue. Another patch will
propose to pin the version of pylint.

Change-Id: I5377cf152e62a74f6bf0c4ccc8ce3a563066adab

neutron/agent/l3/event_observers.py

index ab7c3693bcc6084b21abf1dada072f4f13c236df..88f5b4cca460ada395d9ac6307499c145dc54ad3 100644 (file)
@@ -24,7 +24,7 @@ class L3EventObservers(object):
     def add(self, new_observer):
         """Add a listener for L3 agent notifications."""
         for observer in self.observers:
-            if type(observer) == type(new_observer):
+            if isinstance(new_observer, type(observer)):
                 raise ValueError('Only a single instance of AdvancedService '
                                  'may be registered, per type of service.')