Fix E265 violations and re-enable gating
E265 got stricter in hacking 0.9, so fix new violations and re-enable gating. Change-Id: I64159facb0698c19ea0689e9b1dd5266615ddb45
This commit is contained in:
parent
831c303815
commit
a4ad787b3f
@ -25,7 +25,7 @@ import sys
|
||||
import eventlet
|
||||
# NOTE(jd) We need to monkey patch the socket and select module for,
|
||||
# at least, oslo.messaging, otherwise everything's blocked on its
|
||||
# first read() or select(), thread need to be patched too, because
|
||||
# first read() or select(), thread need to be patched too, because
|
||||
# oslo.messaging use threading.local
|
||||
eventlet.monkey_patch(socket=True, select=True, thread=True)
|
||||
|
||||
|
@ -60,7 +60,7 @@ class NetworkNotificationBase(plugin.NotificationBase):
|
||||
# it may mean we miss charging for some amount of time,
|
||||
# but it is better than throwing away the existing
|
||||
# metadata for a resource when it is deleted.
|
||||
##'%s.delete.start' % (self.resource_name),
|
||||
# '%s.delete.start' % (self.resource_name),
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
|
@ -18,8 +18,7 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""MongoDB storage backend
|
||||
"""
|
||||
"""MongoDB storage backend"""
|
||||
|
||||
import calendar
|
||||
import copy
|
||||
@ -611,7 +610,8 @@ class Connection(pymongo_base.Connection):
|
||||
# sort_keys=[k1, k2, k3], maker_value=[v1, v2, v3]
|
||||
# sort_flags = ['$lt', '$gt', 'lt'].
|
||||
# The query criteria should be
|
||||
#{'k3': {'$lt': 'v3'}, 'k2': {'eq': 'v2'}, 'k1': {'eq': 'v1'}},
|
||||
# {'k3': {'$lt': 'v3'}, 'k2': {'eq': 'v2'}, 'k1':
|
||||
# {'eq': 'v1'}},
|
||||
# {'k2': {'$gt': 'v2'}, 'k1': {'eq': 'v1'}},
|
||||
# {'k1': {'$lt': 'v1'}} with 'OR' operation.
|
||||
# Each recurse will generate one items of three.
|
||||
@ -674,7 +674,7 @@ class Connection(pymongo_base.Connection):
|
||||
q.update(query)
|
||||
|
||||
# NOTE(Fengqian): MongoDB collection.find can not handle limit
|
||||
#when it equals None, it will raise TypeError, so we treate
|
||||
# when it equals None, it will raise TypeError, so we treat
|
||||
# None as 0 for the value of limit.
|
||||
if limit is None:
|
||||
limit = 0
|
||||
|
@ -2868,8 +2868,7 @@ class GetEventTest(EventTestBase):
|
||||
|
||||
def test_get_traits(self):
|
||||
traits = self.conn.get_traits("Bar")
|
||||
#format results in a way that makes them easier to
|
||||
#work with
|
||||
# format results in a way that makes them easier to work with
|
||||
trait_dict = {}
|
||||
for trait in traits:
|
||||
trait_dict[trait.name] = trait.dtype
|
||||
|
3
tox.ini
3
tox.ini
@ -37,13 +37,12 @@ commands = python setup.py build_sphinx
|
||||
commands = {posargs}
|
||||
|
||||
[flake8]
|
||||
# E265 block comment should start with ‘# ‘
|
||||
# F402 import module shadowed by loop variable
|
||||
# H305 imports not grouped correctly
|
||||
# H307 like imports should be grouped together
|
||||
# H405 multi line docstring summary not separated with an empty line
|
||||
# H904 Wrap long lines in parentheses instead of a backslash
|
||||
ignore = E265,F402,H305,H307,H405,H904
|
||||
ignore = F402,H305,H307,H405,H904
|
||||
builtins = _
|
||||
exclude=.venv,.git,.tox,dist,doc,./ceilometer/openstack/common,*lib/python*,*egg,tools,nova_tests,build
|
||||
show-source = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user