From 73c9a5fc7c0ed9758af28e7061428544b2475af0 Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Tue, 23 Dec 2014 11:13:27 +1100 Subject: [PATCH] Enable the "not-callable" pylint check This check catches attempts to call variables that pylint believes are not functions. A trivial example would be: # Trivial example caught by this check: foo = dict() print foo('bar') # <- oops, meant foo['bar'] This change enables the "not-callable" pylint check, after disabling a few cases where the alert triggers but the usage was intended (defining decorators). Change-Id: I09ad929902509018fe7183a15b784601c36b6196 Related-Bug: #1356224 --- .pylintrc | 1 - neutron/agent/securitygroups_rpc.py | 3 ++- neutron/plugins/ml2/drivers/cisco/apic/mechanism_apic.py | 1 + neutron/services/l3_router/l3_apic.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index d343d72a6..28f6f7940 100644 --- a/.pylintrc +++ b/.pylintrc @@ -24,7 +24,6 @@ disable= no-member, no-method-argument, no-self-argument, - not-callable, no-value-for-parameter, super-on-old-class, too-few-format-args, diff --git a/neutron/agent/securitygroups_rpc.py b/neutron/agent/securitygroups_rpc.py index 7681b31ea..fe6785106 100644 --- a/neutron/agent/securitygroups_rpc.py +++ b/neutron/agent/securitygroups_rpc.py @@ -197,7 +197,8 @@ class SecurityGroupAgentRpcMixin(object): "or configured as NoopFirewallDriver."), func.__name__) else: - return func(self, *args, **kwargs) + return func(self, # pylint: disable=not-callable + *args, **kwargs) return decorated_function @skip_if_noopfirewall_or_firewall_disabled diff --git a/neutron/plugins/ml2/drivers/cisco/apic/mechanism_apic.py b/neutron/plugins/ml2/drivers/cisco/apic/mechanism_apic.py index c9ef93202..661b86908 100644 --- a/neutron/plugins/ml2/drivers/cisco/apic/mechanism_apic.py +++ b/neutron/plugins/ml2/drivers/cisco/apic/mechanism_apic.py @@ -79,6 +79,7 @@ class APICMechanismDriver(api.MechanismDriver): inst.synchronizer = ( APICMechanismDriver.get_base_synchronizer(inst)) inst.synchronizer.sync_base() + # pylint: disable=not-callable return f(inst, *args, **kwargs) return inner diff --git a/neutron/services/l3_router/l3_apic.py b/neutron/services/l3_router/l3_apic.py index c4139a651..82ecb706c 100644 --- a/neutron/services/l3_router/l3_apic.py +++ b/neutron/services/l3_router/l3_apic.py @@ -63,6 +63,7 @@ class ApicL3ServicePlugin(db_base_plugin_v2.NeutronDbPluginV2, mechanism_apic.APICMechanismDriver. get_router_synchronizer(inst)) inst.synchronizer.sync_router() + # pylint: disable=not-callable return f(inst, *args, **kwargs) return inner -- 2.45.2