]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Enable the "not-callable" pylint check
authorAngus Lees <gus@inodes.org>
Tue, 23 Dec 2014 00:13:27 +0000 (11:13 +1100)
committerAngus Lees <gus@inodes.org>
Wed, 31 Dec 2014 04:33:44 +0000 (15:33 +1100)
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
neutron/agent/securitygroups_rpc.py
neutron/plugins/ml2/drivers/cisco/apic/mechanism_apic.py
neutron/services/l3_router/l3_apic.py

index d343d72a641b0bb55cdcbb87baa58568b61407a6..28f6f7940f0927d7100fe40911d7eaf0678c6f3c 100644 (file)
--- 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,
index 7681b31ead22d818a759e101061505820ee5d4c7..fe6785106010345c587df4c944a72d8ae8b3a51f 100644 (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
index c9ef932026b9d3c95fdac14aef7c0685ffdde145..661b869088529595423045b574674bccf9a1969d 100644 (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
 
index c4139a651038a2f18cb73caad910244f9e5a42a7..82ecb706cc7645b987b55d6eb2dd8f4527b6b8f6 100644 (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