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
This commit is contained in:
Angus Lees 2014-12-23 11:13:27 +11:00
parent 2b378162f3
commit 73c9a5fc7c
4 changed files with 4 additions and 2 deletions

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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