Merge "pylint: fix too-many-nested-blocks/redefined-argument-from-local"

This commit is contained in:
Zuul 2019-01-16 17:57:15 +00:00 committed by Gerrit Code Review
commit 64542397d8
4 changed files with 27 additions and 27 deletions

View File

@ -54,14 +54,12 @@ disable=
interface-not-implemented,
no-else-return,
no-self-use,
redefined-argument-from-local,
too-many-ancestors,
too-many-arguments,
too-many-branches,
too-many-function-args,
too-many-instance-attributes,
too-many-locals,
too-many-nested-blocks,
too-many-return-statements,
too-many-statements,
useless-object-inheritance

View File

@ -56,9 +56,9 @@ class FormsetRow(horizon_tables.Row):
# on this, because it sets self.cells to [], but later expects a
# OrderedDict. We just fill self.cells with empty Cells.
cells = []
for column in self.table.columns.values():
cell = self.table._meta.cell_class(None, column, self)
cells.append((column.name or column.auto, cell))
for col in self.table.columns.values():
cell = self.table._meta.cell_class(None, col, self)
cells.append((col.name or col.auto, cell))
self.cells = collections.OrderedDict(cells)
def render(self):

View File

@ -218,22 +218,22 @@ class BasePlugin(object):
# for keystone.
domain_auth = None
domain_auth_ref = None
for domain_name in domains:
for _name in domains:
token = unscoped_auth_ref.auth_token
domain_auth = utils.get_token_auth_plugin(
auth_url,
token,
domain_name=domain_name)
domain_name=_name)
try:
domain_auth_ref = domain_auth.get_access(session)
except (keystone_exceptions.ClientException,
keystone_exceptions.AuthorizationFailure):
LOG.info('Attempted scope to domain %s failed, will attempt '
'to scope to another domain.', domain_name)
'to scope to another domain.', _name)
else:
if len(domains) > 1:
LOG.info("More than one valid domain found for user %s,"
" scoping to %s",
unscoped_auth_ref.user_id, domain_name)
unscoped_auth_ref.user_id, _name)
break
return domain_auth, domain_auth_ref

View File

@ -311,24 +311,26 @@ class CreateCGroupWorkflow(workflows.Workflow):
backend_name = None
invalid_backend = False
for selected_vol_type in selected_vol_types:
if not invalid_backend:
for vol_type in vol_types:
if selected_vol_type == vol_type.id:
if (hasattr(vol_type, "extra_specs") and
'volume_backend_name' in vol_type.extra_specs):
vol_type_backend = \
vol_type.extra_specs['volume_backend_name']
if vol_type_backend is None:
invalid_backend = True
break
if backend_name is None:
backend_name = vol_type_backend
if vol_type_backend != backend_name:
invalid_backend = True
break
else:
invalid_backend = True
break
if invalid_backend:
continue
for vol_type in vol_types:
if selected_vol_type != vol_type.id:
continue
if (hasattr(vol_type, "extra_specs") and
'volume_backend_name' in vol_type.extra_specs):
vol_type_backend = \
vol_type.extra_specs['volume_backend_name']
if vol_type_backend is None:
invalid_backend = True
break
if backend_name is None:
backend_name = vol_type_backend
if vol_type_backend != backend_name:
invalid_backend = True
break
else:
invalid_backend = True
break
if invalid_backend:
msg = _('All selected volume types must be associated '