]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Enable no-name-in-module pylint check
authorAngus Lees <gus@inodes.org>
Tue, 21 Oct 2014 22:24:21 +0000 (09:24 +1100)
committerAngus Lees <gus@inodes.org>
Tue, 21 Oct 2014 22:24:21 +0000 (09:24 +1100)
Add _MovedItems (from six.moves) to pylintrc ignored-modules, and adjust
one import of sqlalchemy.orm.properties.RelationshipProperty.

s.o.p.RelationshipProperty is created at import-time in a rather
exciting manner - rearranging the import in this way forces the
import-time code to be executed and seems sufficient to satisfy the
pylint static check.

Change-Id: Ic99dc2b7dfac75930a5c446ae899eaae09ee6174

.pylintrc
neutron/db/sqlalchemyutils.py

index c738c547c1dc78f5b756120906d133c9aa2a534d..699f4192f18c8503cb66b1f22af8309253ee06e6 100644 (file)
--- a/.pylintrc
+++ b/.pylintrc
@@ -25,7 +25,6 @@ disable=
  maybe-no-member,
  no-member,
  no-method-argument,
- no-name-in-module,
  no-self-argument,
  not-callable,
  no-value-for-parameter,
@@ -130,6 +129,10 @@ deprecated-modules=
 # should use openstack.common.jsonutils
  json
 
+[TYPECHECK]
+# List of module names for which member attributes should not be checked
+ignored-modules=six.moves,_MovedItems
+
 [REPORTS]
 # Tells whether to display a full report or only the messages
 reports=no
index adf034432684fab3c9db349bb074234e1a3e4016..b21edc83e442b532728cfafd8218edf295242eae 100644 (file)
@@ -15,7 +15,7 @@
 
 from six import moves
 import sqlalchemy
-from sqlalchemy.orm.properties import RelationshipProperty
+from sqlalchemy.orm import properties
 
 from neutron.common import exceptions as n_exc
 from neutron.openstack.common import log as logging
@@ -72,7 +72,7 @@ def paginate_query(query, model, limit, sorts, marker_obj=None):
             # existed in attr_info, it will be catched at here
             msg = _("%s is invalid attribute for sort_key") % sort_key
             raise n_exc.BadRequest(resource=model.__tablename__, msg=msg)
-        if isinstance(sort_key_attr.property, RelationshipProperty):
+        if isinstance(sort_key_attr.property, properties.RelationshipProperty):
             msg = _("The attribute '%(attr)s' is reference to other "
                     "resource, can't used by sort "
                     "'%(resource)s'") % {'attr': sort_key,