From: Assaf Muller Date: Wed, 11 Mar 2015 15:45:00 +0000 (-0400) Subject: Fix pylint issue with type VS isinstance in event_observers X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c7d809408682c127d4389cfcd43e03d079351d06;p=openstack-build%2Fneutron-build.git Fix pylint issue with type VS isinstance in event_observers 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 --- diff --git a/neutron/agent/l3/event_observers.py b/neutron/agent/l3/event_observers.py index ab7c3693b..88f5b4cca 100644 --- a/neutron/agent/l3/event_observers.py +++ b/neutron/agent/l3/event_observers.py @@ -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.')