Fix issues with newer flake8
The updated flake8 seems to have fixed a check for .format() issues that discovered a bug in one of our tests, which is fixed here. Also get rid of using "l" as a variable name and tag the imports that need to stay in order after setting an environment variable. Change-Id: I28de0ffa68f9bff4685d81fe7b5a5d8909e2313c
This commit is contained in:
@@ -19,9 +19,9 @@ import os
|
||||
# the /etc/hosts file, causing problems for installs.
|
||||
os.environ['EVENTLET_NO_GREENDNS'] = 'yes' # noqa
|
||||
|
||||
from oslo_log import log
|
||||
from oslo_concurrency import lockutils
|
||||
import oslo_messaging as messaging
|
||||
from oslo_log import log # noqa
|
||||
from oslo_concurrency import lockutils # noqa
|
||||
import oslo_messaging as messaging # noqa
|
||||
|
||||
_EXTRA_DEFAULT_LOG_LEVELS = [
|
||||
'kazoo.client=WARN',
|
||||
|
@@ -458,7 +458,7 @@ class CentralServiceTestCase(CentralBasic):
|
||||
# we will hit it if we try to do the operations in a loop 100 times.
|
||||
for num in range(100):
|
||||
recordset = Mock()
|
||||
recordset.name = "b%s".format(num)
|
||||
recordset.name = "b{}".format(num)
|
||||
recordset.obj_attr_is_set.return_value = True
|
||||
recordset.records = [MockRecord()]
|
||||
|
||||
|
@@ -61,10 +61,10 @@ designate_cli_path = '/usr/local/bin/designate'
|
||||
openstack_cli = 'openstack'
|
||||
|
||||
|
||||
def gen_random_name(l):
|
||||
def gen_random_name(length):
|
||||
return "".join(
|
||||
random.choice(string.ascii_lowercase + string.digits)
|
||||
for n in range(l)
|
||||
for n in range(length)
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user