Merge "Fix some pylint indentation warnings"
This commit is contained in:
commit
a358bb802b
@ -464,8 +464,8 @@ def convert_exception_to_http_exc(e, faults, language):
|
||||
for c in converted_exceptions:
|
||||
c_body = jsonutils.loads(c.body)
|
||||
err = ('HTTP %s %s: %s' % (
|
||||
c.code, c_body['NeutronError']['type'],
|
||||
c_body['NeutronError']['message']))
|
||||
c.code, c_body['NeutronError']['type'],
|
||||
c_body['NeutronError']['message']))
|
||||
inner_error_strings.append(err)
|
||||
new_exception.msg = "\n".join(inner_error_strings)
|
||||
return convert_exception_to_http_exc(
|
||||
|
@ -313,7 +313,7 @@ class DhcpRpcCallback(object):
|
||||
old_port = plugin.get_port(context, port['id'])
|
||||
if (old_port['device_id'] !=
|
||||
constants.DEVICE_ID_RESERVED_DHCP_PORT and
|
||||
old_port['device_id'] !=
|
||||
old_port['device_id'] !=
|
||||
utils.get_dhcp_agent_device_id(network_id, host)):
|
||||
return
|
||||
if not self._is_dhcp_agent_hosting_network(plugin, context, host,
|
||||
|
@ -192,9 +192,9 @@ class L3RpcCallback(object):
|
||||
portbindings.VIF_TYPE_BINDING_FAILED,
|
||||
portbindings.VIF_TYPE_UNBOUND)
|
||||
if (port and host is not None and
|
||||
(port.get('device_owner') !=
|
||||
constants.DEVICE_OWNER_DVR_INTERFACE and
|
||||
port.get(portbindings.HOST_ID) != host or not_bound)):
|
||||
(port.get('device_owner') !=
|
||||
constants.DEVICE_OWNER_DVR_INTERFACE and
|
||||
port.get(portbindings.HOST_ID) != host or not_bound)):
|
||||
|
||||
# Ports owned by non-HA routers are bound again if they're
|
||||
# already bound but the router moved to another host.
|
||||
@ -335,10 +335,10 @@ class L3RpcCallback(object):
|
||||
|
||||
updated_subnets = []
|
||||
for subnet_id, prefix in subnets.items():
|
||||
updated_subnets.append(self.plugin.update_subnet(
|
||||
context,
|
||||
subnet_id,
|
||||
{'subnet': {'cidr': prefix}}))
|
||||
updated_subnets.append(
|
||||
self.plugin.update_subnet(context,
|
||||
subnet_id,
|
||||
{'subnet': {'cidr': prefix}}))
|
||||
return updated_subnets
|
||||
|
||||
@db_api.retry_db_errors
|
||||
|
@ -236,10 +236,11 @@ class ResourcesPushRpcApi(object):
|
||||
resources_by_type = self._classify_resources_by_type(resource_list)
|
||||
LOG.debug(
|
||||
"Pushing event %s for resources: %s", event_type,
|
||||
{t: ["ID=%s,revision_number=%s" % (
|
||||
getattr(obj, 'id', None),
|
||||
getattr(obj, 'revision_number', None))
|
||||
for obj in resources_by_type[t]]
|
||||
{t:
|
||||
["ID=%s,revision_number=%s" % (
|
||||
getattr(obj, 'id', None),
|
||||
getattr(obj, 'revision_number', None))
|
||||
for obj in resources_by_type[t]]
|
||||
for t in resources_by_type})
|
||||
for resource_type, type_resources in resources_by_type.items():
|
||||
self._push(context, resource_type, type_resources, event_type)
|
||||
|
@ -330,7 +330,7 @@ class Controller(object):
|
||||
request.context, obj_list[0])
|
||||
collection = {self._collection:
|
||||
[self._filter_attributes(
|
||||
obj, fields_to_strip=fields_to_strip)
|
||||
obj, fields_to_strip=fields_to_strip)
|
||||
for obj in obj_list]}
|
||||
pagination_links = pagination_helper.get_links(obj_list)
|
||||
if pagination_links:
|
||||
@ -550,9 +550,10 @@ class Controller(object):
|
||||
# should be removed because of authZ policies
|
||||
fields_to_strip = self._exclude_attributes_by_policy(
|
||||
request.context, objs[0])
|
||||
return notify({self._collection: [self._filter_attributes(
|
||||
obj, fields_to_strip=fields_to_strip)
|
||||
for obj in objs]})
|
||||
return notify({self._collection:
|
||||
[self._filter_attributes(
|
||||
obj, fields_to_strip=fields_to_strip)
|
||||
for obj in objs]})
|
||||
else:
|
||||
if self._collection in body:
|
||||
# Emulate atomic bulk behavior
|
||||
|
Loading…
x
Reference in New Issue
Block a user