Browse Source

Merge "Fix pep8 E128 warnings in non-test code"

Zuul 1 month ago
parent
commit
c21d922abd
100 changed files with 379 additions and 310 deletions
  1. 1
    1
      neutron/agent/common/ovs_lib.py
  2. 2
    2
      neutron/agent/l2/l2_agent_extensions_manager.py
  3. 3
    3
      neutron/agent/l3/dvr_edge_router.py
  4. 1
    1
      neutron/agent/l3/dvr_fip_ns.py
  5. 1
    2
      neutron/agent/l3/dvr_local_router.py
  6. 2
    2
      neutron/agent/l3/l3_agent_extensions_manager.py
  7. 4
    3
      neutron/agent/l3/router_info.py
  8. 2
    2
      neutron/agent/linux/dhcp.py
  9. 2
    2
      neutron/agent/linux/ip_conntrack.py
  10. 1
    1
      neutron/agent/linux/ipset_manager.py
  11. 5
    3
      neutron/agent/linux/iptables_firewall.py
  12. 1
    1
      neutron/agent/linux/iptables_manager.py
  13. 2
    1
      neutron/agent/linux/openvswitch_firewall/firewall.py
  14. 18
    10
      neutron/agent/linux/ra.py
  15. 5
    3
      neutron/agent/metadata/agent.py
  16. 1
    1
      neutron/api/rpc/callbacks/version_manager.py
  17. 1
    1
      neutron/api/rpc/handlers/dhcp_rpc.py
  18. 1
    2
      neutron/api/rpc/handlers/dvr_rpc.py
  19. 7
    7
      neutron/api/rpc/handlers/l3_rpc.py
  20. 4
    2
      neutron/api/rpc/handlers/resources_rpc.py
  21. 2
    2
      neutron/api/v2/base.py
  22. 2
    1
      neutron/cmd/sanity/checks.py
  23. 6
    5
      neutron/cmd/upgrade_checks/checks.py
  24. 6
    4
      neutron/conf/services/extdns_designate_driver.py
  25. 1
    1
      neutron/db/agentschedulers_db.py
  26. 1
    1
      neutron/db/allowedaddresspairs_db.py
  27. 2
    1
      neutron/db/data_plane_status_db.py
  28. 1
    1
      neutron/db/db_base_plugin_common.py
  29. 8
    9
      neutron/db/db_base_plugin_v2.py
  30. 4
    2
      neutron/db/dns_db.py
  31. 1
    1
      neutron/db/extraroute_db.py
  32. 2
    2
      neutron/db/flavors_db.py
  33. 2
    1
      neutron/db/ipam_backend_mixin.py
  34. 3
    3
      neutron/db/ipam_pluggable_backend.py
  35. 8
    7
      neutron/db/l3_agentschedulers_db.py
  36. 20
    17
      neutron/db/l3_db.py
  37. 3
    3
      neutron/db/l3_dvr_db.py
  38. 2
    2
      neutron/db/l3_dvrscheduler_db.py
  39. 1
    1
      neutron/db/l3_gwmode_db.py
  40. 13
    10
      neutron/db/l3_hamode_db.py
  41. 6
    3
      neutron/db/migration/alembic_migrations/cisco_init_ops.py
  42. 2
    2
      neutron/db/migration/alembic_migrations/core_init_ops.py
  43. 1
    1
      neutron/db/migration/alembic_migrations/versions/newton/contract/2e0d7a8a1586_add_binding_index_to_routerl3agentbinding.py
  44. 1
    1
      neutron/db/migration/alembic_migrations/versions/newton/contract/c879c5e1ee90_add_segment_id_to_subnet.py
  45. 2
    1
      neutron/db/migration/alembic_migrations/versions/newton/expand/0f5bef0f87d4_add_qos_minimum_bandwidth_rules.py
  46. 6
    3
      neutron/db/migration/alembic_migrations/versions/newton/expand/5abc0278ca73_add_support_for_vlan_trunking.py
  47. 2
    1
      neutron/db/migration/alembic_migrations/versions/newton/expand/a5648cfeeadf_add_subnet_service_types.py
  48. 4
    4
      neutron/db/migration/alembic_migrations/versions/ocata/expand/a9c43481023c_extend_ml2_port_bindings.py
  49. 2
    1
      neutron/db/migration/alembic_migrations/versions/stein/expand/9bfad3f1e780_support_shared_security_groups.py
  50. 1
    1
      neutron/db/migration/cli.py
  51. 2
    1
      neutron/db/models/flavor.py
  52. 1
    1
      neutron/db/models/l3.py
  53. 1
    1
      neutron/db/models/plugins/ml2/geneveallocation.py
  54. 16
    13
      neutron/db/securitygroups_db.py
  55. 6
    6
      neutron/db/servicetype_db.py
  56. 2
    1
      neutron/db/uplink_status_propagation_db.py
  57. 7
    6
      neutron/extensions/subnet_service_types.py
  58. 2
    2
      neutron/ipam/drivers/neutrondb_ipam/db_api.py
  59. 2
    2
      neutron/ipam/drivers/neutrondb_ipam/driver.py
  60. 11
    11
      neutron/ipam/subnet_alloc.py
  61. 1
    1
      neutron/objects/l3agent.py
  62. 2
    2
      neutron/objects/network.py
  63. 7
    7
      neutron/objects/ports.py
  64. 6
    3
      neutron/objects/router.py
  65. 8
    4
      neutron/objects/tag.py
  66. 1
    1
      neutron/pecan_wsgi/hooks/context.py
  67. 2
    2
      neutron/pecan_wsgi/hooks/translation.py
  68. 2
    1
      neutron/plugins/ml2/db.py
  69. 2
    2
      neutron/plugins/ml2/drivers/helpers.py
  70. 4
    2
      neutron/plugins/ml2/drivers/l2pop/db.py
  71. 1
    1
      neutron/plugins/ml2/drivers/l2pop/mech_driver.py
  72. 3
    2
      neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py
  73. 6
    3
      neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py
  74. 2
    2
      neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py
  75. 8
    8
      neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_dvr_process.py
  76. 3
    2
      neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_phys.py
  77. 1
    1
      neutron/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/br_phys.py
  78. 3
    3
      neutron/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/br_tun.py
  79. 2
    2
      neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py
  80. 15
    15
      neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py
  81. 8
    5
      neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py
  82. 2
    2
      neutron/plugins/ml2/drivers/type_tunnel.py
  83. 7
    5
      neutron/plugins/ml2/extensions/dns_integration.py
  84. 8
    8
      neutron/plugins/ml2/plugin.py
  85. 1
    1
      neutron/privileged/agent/linux/netlink_lib.py
  86. 1
    1
      neutron/quota/__init__.py
  87. 1
    1
      neutron/scheduler/base_scheduler.py
  88. 3
    2
      neutron/scheduler/dhcp_agent_scheduler.py
  89. 7
    7
      neutron/services/auto_allocate/db.py
  90. 3
    2
      neutron/services/network_ip_availability/plugin.py
  91. 1
    1
      neutron/services/placement_report/plugin.py
  92. 1
    1
      neutron/services/qos/qos_plugin.py
  93. 5
    4
      neutron/services/segments/plugin.py
  94. 3
    3
      neutron/services/tag/tag_plugin.py
  95. 1
    1
      neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py
  96. 1
    1
      neutron/tests/common/l3_test_common.py
  97. 16
    13
      neutron/tests/functional/agent/l3/framework.py
  98. 1
    1
      neutron/tests/unit/agent/l3/test_agent.py
  99. 1
    1
      neutron/tests/unit/agent/l3/test_dvr_fip_ns.py
  100. 0
    0
      neutron/tests/unit/agent/linux/test_keepalived.py

+ 1
- 1
neutron/agent/common/ovs_lib.py View File

@@ -469,7 +469,7 @@ class OVSBridge(BaseOVS):
469 469
         if "cookie" in kwargs:
470 470
             kwargs["cookie"] = check_cookie_mask(str(kwargs["cookie"]))
471 471
         flow_str = ",".join("=".join([key, str(val)])
472
-            for key, val in kwargs.items())
472
+                            for key, val in kwargs.items())
473 473
 
474 474
         flows = self.run_ofctl("dump-flows", [flow_str])
475 475
         if flows:

+ 2
- 2
neutron/agent/l2/l2_agent_extensions_manager.py View File

@@ -32,8 +32,8 @@ class L2AgentExtensionsManager(agent_ext_manager.AgentExtensionsManager):
32 32
     """
33 33
 
34 34
     def __init__(self, conf):
35
-        super(L2AgentExtensionsManager, self).__init__(conf,
36
-                L2_AGENT_EXT_MANAGER_NAMESPACE)
35
+        super(L2AgentExtensionsManager,
36
+              self).__init__(conf, L2_AGENT_EXT_MANAGER_NAMESPACE)
37 37
 
38 38
     def handle_port(self, context, data):
39 39
         """Notify all agent extensions to handle port."""

+ 3
- 3
neutron/agent/l3/dvr_edge_router.py View File

@@ -82,9 +82,9 @@ class DvrEdgeRouter(dvr_local_router.DvrLocalRouter):
82 82
         else:
83 83
             preserve_ips = self._list_centralized_floating_ip_cidrs()
84 84
             self._external_gateway_added(ex_gw_port,
85
-                                        interface_name,
86
-                                        self.snat_namespace.name,
87
-                                        preserve_ips)
85
+                                         interface_name,
86
+                                         self.snat_namespace.name,
87
+                                         preserve_ips)
88 88
 
89 89
     def _external_gateway_removed(self, ex_gw_port, interface_name):
90 90
         super(DvrEdgeRouter, self).external_gateway_removed(ex_gw_port,

+ 1
- 1
neutron/agent/l3/dvr_fip_ns.py View File

@@ -316,7 +316,7 @@ class FipNamespace(namespaces.Namespace):
316 316
             is_ipv6=False)
317 317
 
318 318
     def _update_gateway_route(self, agent_gateway_port,
319
-                             interface_name, tbl_index):
319
+                              interface_name, tbl_index):
320 320
         ns_name = self.get_name()
321 321
         ipd = ip_lib.IPDevice(interface_name, namespace=ns_name)
322 322
         # If the 'fg-' device doesn't exist in the namespace then trying

+ 1
- 2
neutron/agent/l3/dvr_local_router.py View File

@@ -318,8 +318,7 @@ class DvrLocalRouter(dvr_router_base.DvrRouterBase):
318 318
     def _delete_gateway_device_if_exists(self, ns_ip_device, gw_ip_addr,
319 319
                                          snat_idx):
320 320
         try:
321
-            ns_ip_device.route.delete_gateway(gw_ip_addr,
322
-                                        table=snat_idx)
321
+            ns_ip_device.route.delete_gateway(gw_ip_addr, table=snat_idx)
323 322
         except exceptions.DeviceNotFoundError:
324 323
             pass
325 324
 

+ 2
- 2
neutron/agent/l3/l3_agent_extensions_manager.py View File

@@ -32,8 +32,8 @@ class L3AgentExtensionsManager(agent_ext_manager.AgentExtensionsManager):
32 32
     """Manage l3 agent extensions."""
33 33
 
34 34
     def __init__(self, conf):
35
-        super(L3AgentExtensionsManager, self).__init__(conf,
36
-                L3_AGENT_EXT_MANAGER_NAMESPACE)
35
+        super(L3AgentExtensionsManager,
36
+              self).__init__(conf, L3_AGENT_EXT_MANAGER_NAMESPACE)
37 37
 
38 38
     def add_router(self, context, data):
39 39
         """Notify all agent extensions to add router."""

+ 4
- 3
neutron/agent/l3/router_info.py View File

@@ -377,7 +377,7 @@ class RouterInfo(object):
377 377
                            'new': fip['fixed_ip_address']})
378 378
                 fip_statuses[fip['id']] = self.move_floating_ip(fip)
379 379
             elif (ip_cidr in centralized_fip_cidrs and
380
-                fip.get('host') == self.host):
380
+                  fip.get('host') == self.host):
381 381
                 LOG.debug("Floating IP is migrating from centralized "
382 382
                           "to distributed: %s", fip)
383 383
                 fip_statuses[fip['id']] = self.migrate_centralized_floating_ip(
@@ -587,8 +587,9 @@ class RouterInfo(object):
587 587
                 if ipv6_utils.is_ipv6_pd_enabled(subnet):
588 588
                     interface_name = self.get_internal_device_name(p['id'])
589 589
                     self.agent.pd.enable_subnet(self.router_id, subnet['id'],
590
-                                     subnet['cidr'],
591
-                                     interface_name, p['mac_address'])
590
+                                                subnet['cidr'],
591
+                                                interface_name,
592
+                                                p['mac_address'])
592 593
                     if (subnet['cidr'] !=
593 594
                             lib_constants.PROVISIONAL_IPV6_PD_PREFIX):
594 595
                         self.pd_subnets[subnet['id']] = subnet['cidr']

+ 2
- 2
neutron/agent/linux/dhcp.py View File

@@ -718,8 +718,8 @@ class Dnsmasq(DhcpLocalProcess):
718 718
                                ip_address, 'set:', port.id))
719 719
                 elif client_id and len(port.extra_dhcp_opts) == 1:
720 720
                     buf.write('%s,%s%s,%s,%s\n' %
721
-                          (port.mac_address, self._ID, client_id, name,
722
-                           ip_address))
721
+                              (port.mac_address, self._ID, client_id, name,
722
+                               ip_address))
723 723
                 else:
724 724
                     buf.write('%s,%s,%s,%s%s\n' %
725 725
                               (port.mac_address, name, ip_address,

+ 2
- 2
neutron/agent/linux/ip_conntrack.py View File

@@ -185,8 +185,8 @@ class IpConntrackManager(object):
185 185
                              r'.* -j CT --zone (?P<zone>\d+).*', rule)
186 186
             if match:
187 187
                 # strip off any prefix that the interface is using
188
-                short_port_id = (match.group('dev')
189
-                    [n_const.LINUX_DEV_PREFIX_LEN:])
188
+                short_port_id = (
189
+                    match.group('dev')[n_const.LINUX_DEV_PREFIX_LEN:])
190 190
                 self._device_zone_map[short_port_id] = int(match.group('zone'))
191 191
         LOG.debug("Populated conntrack zone map: %s", self._device_zone_map)
192 192
 

+ 1
- 1
neutron/agent/linux/ipset_manager.py View File

@@ -119,7 +119,7 @@ class IpsetManager(object):
119 119
         new_set_name = set_name + SWAP_SUFFIX
120 120
         set_type = self._get_ipset_set_type(ethertype)
121 121
         process_input = ["create %s hash:net family %s" % (new_set_name,
122
-                                                          set_type)]
122
+                                                           set_type)]
123 123
         for ip in member_ips:
124 124
             process_input.append("add %s %s" % (new_set_name, ip))
125 125
 

+ 5
- 3
neutron/agent/linux/iptables_firewall.py View File

@@ -72,7 +72,8 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
72 72
     CONNTRACK_ZONE_PER_PORT = False
73 73
 
74 74
     def __init__(self, namespace=None):
75
-        self.iptables = iptables_manager.IptablesManager(state_less=True,
75
+        self.iptables = iptables_manager.IptablesManager(
76
+            state_less=True,
76 77
             use_ipv6=ipv6_utils.is_enabled_and_bind_by_default(),
77 78
             namespace=namespace)
78 79
         # TODO(majopela, shihanzhang): refactor out ipset to a separate
@@ -722,8 +723,9 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
722 723
 
723 724
             if (is_port and rule_protocol in constants.IPTABLES_PROTOCOL_MAP):
724 725
                 # iptables adds '-m protocol' when the port number is specified
725
-                iptables_rule += ['-m',
726
-                    constants.IPTABLES_PROTOCOL_MAP[rule_protocol]]
726
+                iptables_rule += [
727
+                    '-m', constants.IPTABLES_PROTOCOL_MAP[rule_protocol]
728
+                ]
727 729
         return iptables_rule
728 730
 
729 731
     def _port_arg(self, direction, protocol, port_range_min, port_range_max):

+ 1
- 1
neutron/agent/linux/iptables_manager.py View File

@@ -815,7 +815,7 @@ def _get_rules_by_chain(rules):
815 815
 
816 816
 
817 817
 def _generate_chain_diff_iptables_commands(chain, old_chain_rules,
818
-                                          new_chain_rules):
818
+                                           new_chain_rules):
819 819
     # keep track of the old index because we have to insert rules
820 820
     # in the right position
821 821
     old_index = 1

+ 2
- 1
neutron/agent/linux/openvswitch_firewall/firewall.py View File

@@ -326,7 +326,8 @@ class ConjIPFlowManager(object):
326 326
             # no address overlaps.
327 327
             addr_to_conj = self._build_addr_conj_id_map(
328 328
                 ethertype, sg_conj_id_map)
329
-            self._update_flows_for_vlan_subr(direction, ethertype, vlan_tag,
329
+            self._update_flows_for_vlan_subr(
330
+                direction, ethertype, vlan_tag,
330 331
                 self.flow_state[vlan_tag][(direction, ethertype)],
331 332
                 addr_to_conj)
332 333
             self.flow_state[vlan_tag][(direction, ethertype)] = addr_to_conj

+ 18
- 10
neutron/agent/linux/ra.py View File

@@ -98,20 +98,28 @@ class DaemonMonitor(object):
98 98
         for p in router_ports:
99 99
             subnets = p.get('subnets', [])
100 100
             v6_subnets = [subnet for subnet in subnets if
101
-                    netaddr.IPNetwork(subnet['cidr']).version == 6]
101
+                          netaddr.IPNetwork(subnet['cidr']).version == 6]
102 102
             if not v6_subnets:
103 103
                 continue
104 104
             ra_modes = {subnet['ipv6_ra_mode'] for subnet in v6_subnets}
105
-            auto_config_prefixes = [subnet['cidr'] for subnet in v6_subnets if
106
-                    subnet['ipv6_ra_mode'] == constants.IPV6_SLAAC or
107
-                    subnet['ipv6_ra_mode'] == constants.DHCPV6_STATELESS]
108
-            stateful_config_prefixes = [subnet['cidr'] for subnet in v6_subnets
109
-                    if subnet['ipv6_ra_mode'] == constants.DHCPV6_STATEFUL]
105
+            auto_config_prefixes = [
106
+                subnet['cidr'] for subnet in v6_subnets
107
+                if (subnet['ipv6_ra_mode'] == constants.IPV6_SLAAC or
108
+                    subnet['ipv6_ra_mode'] == constants.DHCPV6_STATELESS)
109
+            ]
110
+            stateful_config_prefixes = [
111
+                subnet['cidr'] for subnet in v6_subnets
112
+                if subnet['ipv6_ra_mode'] == constants.DHCPV6_STATEFUL
113
+            ]
110 114
             interface_name = self._dev_name_helper(p['id'])
111
-            slaac_subnets = [subnet for subnet in v6_subnets if
112
-                subnet['ipv6_ra_mode'] == constants.IPV6_SLAAC]
113
-            dns_servers = list(iter_chain(*[subnet['dns_nameservers'] for
114
-                subnet in slaac_subnets if subnet.get('dns_nameservers')]))
115
+            slaac_subnets = [
116
+                subnet for subnet in v6_subnets
117
+                if subnet['ipv6_ra_mode'] == constants.IPV6_SLAAC
118
+            ]
119
+            dns_servers = list(iter_chain(*[
120
+                subnet['dns_nameservers'] for subnet in slaac_subnets
121
+                if subnet.get('dns_nameservers')
122
+            ]))
115 123
             network_mtu = p.get('mtu', 0)
116 124
 
117 125
             buf.write('%s' % CONFIG_TEMPLATE.render(

+ 5
- 3
neutron/agent/metadata/agent.py View File

@@ -162,9 +162,11 @@ class MetadataProxyHandler(object):
162 162
         ports = self._get_ports(remote_address, network_id, router_id)
163 163
         LOG.debug("Gotten ports for remote_address %(remote_address)s, "
164 164
                   "network_id %(network_id)s, router_id %(router_id)s are: "
165
-                  "%(ports)s", {"remote_address": remote_address,
166
-                  "network_id": network_id, "router_id": router_id,
167
-                  "ports": ports})
165
+                  "%(ports)s",
166
+                  {"remote_address": remote_address,
167
+                   "network_id": network_id,
168
+                   "router_id": router_id,
169
+                   "ports": ports})
168 170
 
169 171
         if len(ports) == 1:
170 172
             return ports[0]['device_id'], ports[0]['tenant_id']

+ 1
- 1
neutron/api/rpc/callbacks/version_manager.py View File

@@ -131,7 +131,7 @@ class ResourceConsumerTracker(object):
131 131
         """
132 132
         for resource_type, resource_version in versions.items():
133 133
             self._set_version(consumer, resource_type,
134
-                             resource_version)
134
+                              resource_version)
135 135
 
136 136
         if versions:
137 137
             self._cleanup_removed_versions(consumer, versions)

+ 1
- 1
neutron/api/rpc/handlers/dhcp_rpc.py View File

@@ -296,7 +296,7 @@ class DhcpRpcCallback(object):
296 296
                 old_port['device_id'] !=
297 297
                     utils.get_dhcp_agent_device_id(network_id, host) or
298 298
                 not self._is_dhcp_agent_hosting_network(plugin, context, host,
299
-                    network_id)):
299
+                                                        network_id)):
300 300
                 raise exceptions.DhcpPortInUse(port_id=port['id'])
301 301
             LOG.debug('Update dhcp port %(port)s '
302 302
                       'from %(host)s.',

+ 1
- 2
neutron/api/rpc/handlers/dvr_rpc.py View File

@@ -102,8 +102,7 @@ class DVRServerRpcCallback(object):
102 102
         host = kwargs.get('host')
103 103
         subnet = kwargs.get('subnet')
104 104
         LOG.debug("DVR Agent requests list of VM ports on host %s", host)
105
-        return self.plugin.get_ports_on_host_by_subnet(context,
106
-            host, subnet)
105
+        return self.plugin.get_ports_on_host_by_subnet(context, host, subnet)
107 106
 
108 107
     def get_subnet_for_dvr(self, context, **kwargs):
109 108
         fixed_ips = kwargs.get('fixed_ips')

+ 7
- 7
neutron/api/rpc/handlers/l3_rpc.py View File

@@ -230,11 +230,10 @@ class L3RpcCallback(object):
230 230
             # of hosts on which DVR router interfaces are spawned). Such
231 231
             # bindings are created/updated here by invoking
232 232
             # update_distributed_port_binding
233
-            self.plugin.update_distributed_port_binding(context, port['id'],
234
-                                                {'port':
235
-                                                 {portbindings.HOST_ID: host,
236
-                                                  'device_id': router_id}
237
-                                                 })
233
+            self.plugin.update_distributed_port_binding(
234
+                context, port['id'],
235
+                {'port': {portbindings.HOST_ID: host,
236
+                          'device_id': router_id}})
238 237
 
239 238
     def get_external_network_id(self, context, **kwargs):
240 239
         """Get one external network id for l3 agent.
@@ -305,8 +304,9 @@ class L3RpcCallback(object):
305 304
             admin_ctx, network_id, host)
306 305
         self._ensure_host_set_on_port(admin_ctx, host, agent_port)
307 306
         LOG.debug('Agent Gateway port returned : %(agent_port)s with '
308
-                  'host %(host)s', {'agent_port': agent_port,
309
-                  'host': host})
307
+                  'host %(host)s',
308
+                  {'agent_port': agent_port,
309
+                   'host': host})
310 310
         return agent_port
311 311
 
312 312
     @db_api.retry_db_errors

+ 4
- 2
neutron/api/rpc/handlers/resources_rpc.py View File

@@ -94,7 +94,8 @@ class ResourcesPullRpcApi(object):
94 94
     def pull(self, context, resource_type, resource_id):
95 95
         resource_type_cls = _resource_to_class(resource_type)
96 96
         cctxt = self.client.prepare()
97
-        primitive = cctxt.call(context, 'pull',
97
+        primitive = cctxt.call(
98
+            context, 'pull',
98 99
             resource_type=resource_type,
99 100
             version=resource_type_cls.VERSION, resource_id=resource_id)
100 101
 
@@ -107,7 +108,8 @@ class ResourcesPullRpcApi(object):
107 108
     def bulk_pull(self, context, resource_type, filter_kwargs=None):
108 109
         resource_type_cls = _resource_to_class(resource_type)
109 110
         cctxt = self.client.prepare()
110
-        primitives = cctxt.call(context, 'bulk_pull',
111
+        primitives = cctxt.call(
112
+            context, 'bulk_pull',
111 113
             resource_type=resource_type,
112 114
             version=resource_type_cls.VERSION, filter_kwargs=filter_kwargs)
113 115
         return [resource_type_cls.clean_obj_from_primitive(primitive)

+ 2
- 2
neutron/api/v2/base.py View File

@@ -327,8 +327,8 @@ class Controller(object):
327 327
             fields_to_strip += self._exclude_attributes_by_policy(
328 328
                 request.context, obj_list[0])
329 329
         collection = {self._collection:
330
-                      [self._filter_attributes(obj,
331
-                          fields_to_strip=fields_to_strip)
330
+                      [self._filter_attributes(
331
+                           obj, fields_to_strip=fields_to_strip)
332 332
                        for obj in obj_list]}
333 333
         pagination_links = pagination_helper.get_links(obj_list)
334 334
         if pagination_links:

+ 2
- 1
neutron/cmd/sanity/checks.py View File

@@ -289,7 +289,8 @@ class KeepalivedIPv6Test(object):
289 289
         self.config_path = tempfile.mkdtemp()
290 290
 
291 291
         # Instantiate keepalived manager with the IPv6 configuration.
292
-        self.manager = keepalived.KeepalivedManager('router1', self.config,
292
+        self.manager = keepalived.KeepalivedManager(
293
+            'router1', self.config,
293 294
             namespace=self.nsname, process_monitor=self.pm,
294 295
             conf_path=self.config_path)
295 296
         self.manager.spawn()

+ 6
- 5
neutron/cmd/upgrade_checks/checks.py View File

@@ -32,10 +32,11 @@ class CoreChecks(base.BaseChecks):
32 32
         if cfg.CONF.api_workers and cfg.CONF.rpc_workers:
33 33
             return upgradecheck.Result(
34 34
                 upgradecheck.Code.SUCCESS, _("Number of workers already "
35
-                "defined in config"))
35
+                                             "defined in config"))
36 36
         else:
37 37
             return upgradecheck.Result(
38
-                upgradecheck.Code.WARNING, _("The default number of workers "
39
-                "has changed. Please see release notes for the new values, "
40
-                "but it is strongly encouraged for deployers to manually set "
41
-                "the values for api_workers and rpc_workers."))
38
+                upgradecheck.Code.WARNING,
39
+                _("The default number of workers "
40
+                  "has changed. Please see release notes for the new values, "
41
+                  "but it is strongly encouraged for deployers to manually "
42
+                  "set the values for api_workers and rpc_workers."))

+ 6
- 4
neutron/conf/services/extdns_designate_driver.py View File

@@ -39,12 +39,14 @@ designate_opts = [
39 39
                       'context')),
40 40
     cfg.BoolOpt('allow_reverse_dns_lookup', default=True,
41 41
                 help=_('Allow the creation of PTR records')),
42
-    cfg.IntOpt('ipv4_ptr_zone_prefix_size', default=24,
42
+    cfg.IntOpt(
43
+        'ipv4_ptr_zone_prefix_size', default=24,
43 44
         help=_('Number of bits in an ipv4 PTR zone that will be considered '
44 45
                'network prefix. It has to align to byte boundary. Minimum '
45 46
                'value is 8. Maximum value is 24. As a consequence, range '
46 47
                'of values is 8, 16 and 24')),
47
-    cfg.IntOpt('ipv6_ptr_zone_prefix_size', default=120,
48
+    cfg.IntOpt(
49
+        'ipv6_ptr_zone_prefix_size', default=120,
48 50
         help=_('Number of bits in an ipv6 PTR zone that will be considered '
49 51
                'network prefix. It has to align to nyble boundary. Minimum '
50 52
                'value is 4. Maximum value is 124. As a consequence, range '
@@ -59,6 +61,6 @@ designate_opts = [
59 61
 def register_designate_opts(CONF=cfg.CONF):
60 62
     CONF.register_opts(designate_opts, 'designate')
61 63
     loading.register_auth_conf_options(CONF, 'designate')
62
-    loading.register_session_conf_options(conf=CONF,
63
-        group='designate',
64
+    loading.register_session_conf_options(
65
+        conf=CONF, group='designate',
64 66
         deprecated_opts={'cafile': [cfg.DeprecatedOpt('ca_cert')]})

+ 1
- 1
neutron/db/agentschedulers_db.py View File

@@ -384,7 +384,7 @@ class DhcpAgentSchedulerDbMixin(dhcpagentscheduler
384 384
                     raise das_exc.NetworkHostedByDHCPAgent(
385 385
                         network_id=network_id, agent_id=id)
386 386
             network.NetworkDhcpAgentBinding(context, dhcp_agent_id=id,
387
-                 network_id=network_id).create()
387
+                                            network_id=network_id).create()
388 388
         dhcp_notifier = self.agent_notifiers.get(constants.AGENT_TYPE_DHCP)
389 389
         if dhcp_notifier:
390 390
             dhcp_notifier.network_added_to_agent(

+ 1
- 1
neutron/db/allowedaddresspairs_db.py View File

@@ -24,7 +24,7 @@ from neutron_lib.objects import exceptions
24 24
 
25 25
 from neutron.common import utils
26 26
 from neutron.objects.port.extensions import (allowedaddresspairs
27
-    as obj_addr_pair)
27
+                                             as obj_addr_pair)
28 28
 
29 29
 
30 30
 @resource_extend.has_resource_extenders

+ 2
- 1
neutron/db/data_plane_status_db.py View File

@@ -21,7 +21,8 @@ class DataPlaneStatusMixin(object):
21 21
     """Mixin class to add data plane status to a port"""
22 22
 
23 23
     def _process_create_port_data_plane_status(self, context, data, res):
24
-        obj = dps_obj.PortDataPlaneStatus(context, port_id=res['id'],
24
+        obj = dps_obj.PortDataPlaneStatus(
25
+            context, port_id=res['id'],
25 26
             data_plane_status=data[dps_lib.DATA_PLANE_STATUS])
26 27
         obj.create()
27 28
         res[dps_lib.DATA_PLANE_STATUS] = data[dps_lib.DATA_PLANE_STATUS]

+ 1
- 1
neutron/db/db_base_plugin_common.py View File

@@ -153,7 +153,7 @@ class DbBasePluginCommon(common_db_mixin.CommonDbMixin):
153 153
                                        for pool in subnet.allocation_pools]
154 154
             res['host_routes'] = [{'destination': str(route.destination),
155 155
                                    'nexthop': str(route.nexthop)}
156
-                                 for route in subnet.host_routes]
156
+                                  for route in subnet.host_routes]
157 157
             res['dns_nameservers'] = [str(dns.address)
158 158
                                       for dns in subnet.dns_nameservers]
159 159
             res['shared'] = subnet.shared

+ 8
- 9
neutron/db/db_base_plugin_v2.py View File

@@ -681,7 +681,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
681 681
         l3plugin = directory.get_plugin(plugin_constants.L3)
682 682
         if l3plugin:
683 683
             gw_ports = self._get_router_gw_ports_by_network(context,
684
-                    network['id'])
684
+                                                            network['id'])
685 685
             router_ids = [p.device_id for p in gw_ports]
686 686
             for id in router_ids:
687 687
                 try:
@@ -711,8 +711,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
711 711
             return
712 712
         external_gateway_info['external_fixed_ips'].append(
713 713
                                      {'subnet_id': subnet['id']})
714
-        info = {'router': {'external_gateway_info':
715
-            external_gateway_info}}
714
+        info = {'router': {'external_gateway_info': external_gateway_info}}
716 715
         l3plugin.update_router(context, router_id, info)
717 716
 
718 717
     @db_api.retry_if_session_inactive()
@@ -724,8 +723,8 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
724 723
         # If this subnet supports auto-addressing, then update any
725 724
         # internal ports on the network with addresses for this subnet.
726 725
         if ipv6_utils.is_auto_address_subnet(result):
727
-            updated_ports = self.ipam.add_auto_addrs_on_network_ports(context,
728
-                                result, ipam_subnet)
726
+            updated_ports = self.ipam.add_auto_addrs_on_network_ports(
727
+                context, result, ipam_subnet)
729 728
             for port_id in updated_ports:
730 729
                 port_info = {'port': {'id': port_id}}
731 730
                 try:
@@ -1336,7 +1335,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
1336 1335
         with db_api.CONTEXT_WRITER.using(context):
1337 1336
             for port in port_data:
1338 1337
                 raw_mac_address = port.pop('mac_address',
1339
-                    constants.ATTR_NOT_SPECIFIED)
1338
+                                           constants.ATTR_NOT_SPECIFIED)
1340 1339
                 if raw_mac_address is constants.ATTR_NOT_SPECIFIED:
1341 1340
                     raw_mac_address = macs.pop()
1342 1341
                 eui_mac_address = netaddr.EUI(raw_mac_address, 48)
@@ -1379,12 +1378,12 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
1379 1378
                     self._enforce_device_owner_not_router_intf_or_device_id(
1380 1379
                         context, pdata.get('device_owner'),
1381 1380
                         pdata.get('device_id'), pdata.get('tenant_id'))
1382
-                bulk_port_data.append(dict(project_id=pdata.get('project_id'),
1381
+                bulk_port_data.append(dict(
1382
+                    project_id=pdata.get('project_id'),
1383 1383
                     name=pdata.get('name'),
1384 1384
                     network_id=pdata.get('network_id'),
1385 1385
                     admin_state_up=pdata.get('admin_state_up'),
1386
-                    status=pdata.get('status',
1387
-                        constants.PORT_STATUS_ACTIVE),
1386
+                    status=pdata.get('status', constants.PORT_STATUS_ACTIVE),
1388 1387
                     mac_address=pdata.get('mac_address'),
1389 1388
                     device_id=pdata.get('device_id'),
1390 1389
                     device_owner=pdata.get('device_owner'),

+ 4
- 2
neutron/db/dns_db.py View File

@@ -92,7 +92,8 @@ class DNSDbMixin(object):
92 92
                 context, floatingip_data, req_data))
93 93
         dns_actions_data = None
94 94
         if current_dns_name and current_dns_domain:
95
-            fip_obj.FloatingIPDNS(context,
95
+            fip_obj.FloatingIPDNS(
96
+                context,
96 97
                 floatingip_id=floatingip_data['id'],
97 98
                 dns_name=req_data[dns_apidef.DNSNAME],
98 99
                 dns_domain=req_data[dns_apidef.DNSDOMAIN],
@@ -149,7 +150,8 @@ class DNSDbMixin(object):
149 150
             else:
150 151
                 return
151 152
         if current_dns_name and current_dns_domain:
152
-            fip_obj.FloatingIPDNS(context,
153
+            fip_obj.FloatingIPDNS(
154
+                context,
153 155
                 floatingip_id=floatingip_data['id'],
154 156
                 dns_name='',
155 157
                 dns_domain='',

+ 1
- 1
neutron/db/extraroute_db.py View File

@@ -143,7 +143,7 @@ class ExtraRoute_dbonly_mixin(l3_db.L3_NAT_dbonly_mixin):
143 143
     def _confirm_router_interface_not_in_use(self, context, router_id,
144 144
                                              subnet_id):
145 145
         super(ExtraRoute_dbonly_mixin,
146
-            self)._confirm_router_interface_not_in_use(
146
+              self)._confirm_router_interface_not_in_use(
147 147
             context, router_id, subnet_id)
148 148
         subnet = self._core_plugin.get_subnet(context, subnet_id)
149 149
         subnet_cidr = netaddr.IPNetwork(subnet['cidr'])

+ 2
- 2
neutron/db/flavors_db.py View File

@@ -222,8 +222,8 @@ class FlavorsDbMixin(common_db_mixin.CommonDbMixin):
222 222
                                  marker=None, page_reverse=False):
223 223
         """From flavor, choose service profile and find provider for driver."""
224 224
 
225
-        objs = obj_flavor.FlavorServiceProfileBinding.get_objects(context,
226
-            flavor_id=flavor_id)
225
+        objs = obj_flavor.FlavorServiceProfileBinding.get_objects(
226
+            context, flavor_id=flavor_id)
227 227
         if not objs:
228 228
             raise flav_exc.FlavorServiceProfileBindingNotFound(
229 229
                 sp_id='', fl_id=flavor_id)

+ 2
- 1
neutron/db/ipam_backend_mixin.py View File

@@ -125,7 +125,8 @@ class IpamBackendMixin(db_base_plugin_common.DbBasePluginCommon):
125 125
                 if _combine(route) == route_str:
126 126
                     route.delete()
127 127
         for route_str in new_route_set - old_route_set:
128
-            route = subnet_obj.Route(context,
128
+            route = subnet_obj.Route(
129
+                context,
129 130
                 destination=common_utils.AuthenticIPNetwork(
130 131
                     route_str.partition("_")[0]),
131 132
                 nexthop=netaddr.IPAddress(route_str.partition("_")[2]),

+ 3
- 3
neutron/db/ipam_pluggable_backend.py View File

@@ -50,7 +50,7 @@ def get_ip_update_not_allowed_device_owner_list():
50 50
 def is_neutron_built_in_router(context, router_id):
51 51
     l3plugin = directory.get_plugin(plugin_consts.L3)
52 52
     return bool(l3plugin and
53
-        l3plugin.router_supports_scheduling(context, router_id))
53
+                l3plugin.router_supports_scheduling(context, router_id))
54 54
 
55 55
 
56 56
 class IpamPluggableBackend(ipam_backend_mixin.IpamBackendMixin):
@@ -437,8 +437,8 @@ class IpamPluggableBackend(ipam_backend_mixin.IpamBackendMixin):
437 437
                 port_copy = copy.deepcopy(original)
438 438
                 port_copy.update(new_port)
439 439
                 port_copy['fixed_ips'] = auto_assign_subnets
440
-                self.allocate_ips_for_port_and_store(context,
441
-                            {'port': port_copy}, port_copy['id'])
440
+                self.allocate_ips_for_port_and_store(
441
+                    context, {'port': port_copy}, port_copy['id'])
442 442
 
443 443
             getattr(db_port, 'fixed_ips')  # refresh relationship before return
444 444
 

+ 8
- 7
neutron/db/l3_agentschedulers_db.py View File

@@ -121,7 +121,7 @@ class L3AgentSchedulerDbMixin(l3agentscheduler.L3AgentSchedulerPluginBase,
121 121
         router_id = router['id']
122 122
         agent_id = agent['id']
123 123
         bindings = rb_obj.RouterL3AgentBinding.get_objects(context,
124
-                          router_id=router_id)
124
+                                                           router_id=router_id)
125 125
         if not bindings:
126 126
             return True
127 127
         for binding in bindings:
@@ -213,7 +213,7 @@ class L3AgentSchedulerDbMixin(l3agentscheduler.L3AgentSchedulerPluginBase,
213 213
         # the routers should be retained. This flag will be used
214 214
         # to check if there are valid routers in this agent.
215 215
         retain_router = self._check_router_retain_needed(context, router,
216
-            agent.host)
216
+                                                         agent.host)
217 217
         if retain_router:
218 218
             l3_notifier.routers_updated_on_host(
219 219
                 context, [router_id], agent.host)
@@ -262,8 +262,8 @@ class L3AgentSchedulerDbMixin(l3agentscheduler.L3AgentSchedulerPluginBase,
262 262
         new_hosts = [agent['host'] for agent in new_agents]
263 263
         router = self.get_router(context, router_id)
264 264
         for host in set(old_hosts) - set(new_hosts):
265
-            retain_router = self._check_router_retain_needed(context,
266
-                router, host)
265
+            retain_router = self._check_router_retain_needed(
266
+                context, router, host)
267 267
             if retain_router:
268 268
                 l3_notifier.routers_updated_on_host(
269 269
                     context, [router_id], host)
@@ -362,9 +362,10 @@ class L3AgentSchedulerDbMixin(l3agentscheduler.L3AgentSchedulerPluginBase,
362 362
         record_objs = rb_obj.RouterL3AgentBinding.get_objects(
363 363
                 context, router_id=router_ids)
364 364
         if admin_state_up is not None:
365
-            l3_agents = ag_obj.Agent.get_objects(context,
366
-                     id=[obj.l3_agent_id for obj in record_objs],
367
-                     admin_state_up=admin_state_up)
365
+            l3_agents = ag_obj.Agent.get_objects(
366
+                context,
367
+                id=[obj.l3_agent_id for obj in record_objs],
368
+                admin_state_up=admin_state_up)
368 369
         else:
369 370
             l3_agents = [
370 371
                 ag_obj.Agent.get_object(context, id=obj.l3_agent_id)

+ 20
- 17
neutron/db/l3_db.py View File

@@ -461,8 +461,9 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
461 461
     def _create_gw_port(self, context, router_id, router, new_network_id,
462 462
                         ext_ips):
463 463
         new_valid_gw_port_attachment = (
464
-            new_network_id and (not router.gw_port or
465
-                              router.gw_port['network_id'] != new_network_id))
464
+            new_network_id and
465
+            (not router.gw_port or
466
+             router.gw_port['network_id'] != new_network_id))
466 467
         if new_valid_gw_port_attachment:
467 468
             subnets = self._core_plugin.get_subnets_by_network(context,
468 469
                                                                new_network_id)
@@ -830,9 +831,11 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
830 831
             if port:
831 832
                 fixed_ips = list(map(dict, port['port']['fixed_ips']))
832 833
                 fixed_ips.append(fixed_ip)
833
-                return self._core_plugin.update_port(context,
834
-                        port['port_id'], {'port':
835
-                            {'fixed_ips': fixed_ips}}), [subnet], False
834
+                return (self._core_plugin.update_port(
835
+                            context, port['port_id'],
836
+                            {'port': {'fixed_ips': fixed_ips}}),
837
+                        [subnet],
838
+                        False)
836 839
 
837 840
         port_data = {'tenant_id': router.tenant_id,
838 841
                      'network_id': subnet['network_id'],
@@ -1031,9 +1034,8 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
1031 1034
                     # multiple prefix port - delete prefix from port
1032 1035
                     fixed_ips = [dict(fip) for fip in p['fixed_ips']
1033 1036
                                  if fip['subnet_id'] != subnet_id]
1034
-                    self._core_plugin.update_port(context, p['id'],
1035
-                            {'port':
1036
-                                {'fixed_ips': fixed_ips}})
1037
+                    self._core_plugin.update_port(
1038
+                        context, p['id'], {'port': {'fixed_ips': fixed_ips}})
1037 1039
                     return (p, [subnet])
1038 1040
                 elif subnet_id in port_subnets:
1039 1041
                     # only one subnet on port - delete the port
@@ -1098,9 +1100,9 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
1098 1100
     def _make_floatingip_dict(self, floatingip, fields=None,
1099 1101
                               process_extensions=True):
1100 1102
         floating_ip_address = (str(floatingip.floating_ip_address)
1101
-            if floatingip.floating_ip_address else None)
1103
+                               if floatingip.floating_ip_address else None)
1102 1104
         fixed_ip_address = (str(floatingip.fixed_ip_address)
1103
-            if floatingip.fixed_ip_address else None)
1105
+                            if floatingip.fixed_ip_address else None)
1104 1106
         res = {'id': floatingip.id,
1105 1107
                'tenant_id': floatingip.project_id,
1106 1108
                'floating_ip_address': floating_ip_address,
@@ -1123,8 +1125,8 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
1123 1125
                                    internal_subnet_id,
1124 1126
                                    external_network_id):
1125 1127
         subnet = self._core_plugin.get_subnet(context, internal_subnet_id)
1126
-        return self.get_router_for_floatingip(context,
1127
-            internal_port, subnet, external_network_id)
1128
+        return self.get_router_for_floatingip(
1129
+            context, internal_port, subnet, external_network_id)
1128 1130
 
1129 1131
     # NOTE(yamamoto): This method is an override point for plugins
1130 1132
     # inheriting this class.  Do not optimize this out.
@@ -1272,7 +1274,8 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
1272 1274
                     fixed_ip_address=netaddr.IPAddress(internal_ip_address))
1273 1275
             if fip_exists:
1274 1276
                 floating_ip_address = (str(floatingip_obj.floating_ip_address)
1275
-                    if floatingip_obj.floating_ip_address else None)
1277
+                                       if floatingip_obj.floating_ip_address
1278
+                                       else None)
1276 1279
                 raise l3_exc.FloatingIPPortAlreadyAssociated(
1277 1280
                     port_id=fip['port_id'],
1278 1281
                     fip_id=floatingip_obj.id,
@@ -1309,7 +1312,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
1309 1312
         if 'description' in fip:
1310 1313
             floatingip_obj.description = fip['description']
1311 1314
         floating_ip_address = (str(floatingip_obj.floating_ip_address)
1312
-            if floatingip_obj.floating_ip_address else None)
1315
+                               if floatingip_obj.floating_ip_address else None)
1313 1316
         return {'fixed_ip_address': internal_ip_address,
1314 1317
                 'fixed_port_id': port_id,
1315 1318
                 'router_id': router_id,
@@ -1324,7 +1327,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
1324 1327
         return any(s.ip_version == 4 for s in net.subnets)
1325 1328
 
1326 1329
     def _create_floatingip(self, context, floatingip,
1327
-            initial_status=constants.FLOATINGIP_STATUS_ACTIVE):
1330
+                           initial_status=constants.FLOATINGIP_STATUS_ACTIVE):
1328 1331
         try:
1329 1332
             registry.publish(resources.FLOATING_IP, events.BEFORE_CREATE,
1330 1333
                              self, payload=events.DBEventPayload(
@@ -1434,7 +1437,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
1434 1437
 
1435 1438
     @db_api.retry_if_session_inactive()
1436 1439
     def create_floatingip(self, context, floatingip,
1437
-            initial_status=constants.FLOATINGIP_STATUS_ACTIVE):
1440
+                          initial_status=constants.FLOATINGIP_STATUS_ACTIVE):
1438 1441
         return self._create_floatingip(context, floatingip, initial_status)
1439 1442
 
1440 1443
     def _update_floatingip(self, context, id, floatingip):
@@ -2043,7 +2046,7 @@ class L3_NAT_db_mixin(L3_NAT_dbonly_mixin, L3RpcNotifierMixin):
2043 2046
         return router_interface_info
2044 2047
 
2045 2048
     def create_floatingip(self, context, floatingip,
2046
-            initial_status=constants.FLOATINGIP_STATUS_ACTIVE):
2049
+                          initial_status=constants.FLOATINGIP_STATUS_ACTIVE):
2047 2050
         floatingip_dict = super(L3_NAT_db_mixin, self).create_floatingip(
2048 2051
             context, floatingip, initial_status)
2049 2052
         router_id = floatingip_dict['router_id']

+ 3
- 3
neutron/db/l3_dvr_db.py View File

@@ -711,7 +711,7 @@ class _DVRAgentInterfaceMixin(object):
711 711
         # Collect gw ports only if available
712 712
         if gw_port_id and gw_ports.get(gw_port_id):
713 713
             l3_agent = ag_obj.Agent.get_object(context,
714
-                id=binding_objs[0].l3_agent_id)
714
+                                               id=binding_objs[0].l3_agent_id)
715 715
             return l3_agent.host
716 716
 
717 717
     def _build_routers_list(self, context, routers, gw_ports):
@@ -810,7 +810,7 @@ class _DVRAgentInterfaceMixin(object):
810 810
 
811 811
     @log_helper.log_method_call
812 812
     def _get_dvr_sync_data(self, context, host, agent, router_ids=None,
813
-                          active=None):
813
+                           active=None):
814 814
         routers, interfaces, floating_ips = self._get_router_info_list(
815 815
             context, router_ids=router_ids, active=active,
816 816
             device_owners=const.ROUTER_INTERFACE_OWNERS)
@@ -1098,7 +1098,7 @@ class _DVRAgentInterfaceMixin(object):
1098 1098
     def _get_address_pair_active_port_with_fip(
1099 1099
             self, context, port_dict, port_addr_pair_ip):
1100 1100
         port_valid_state = (port_dict['admin_state_up'] or
1101
-            (port_dict['status'] == const.PORT_STATUS_ACTIVE))
1101
+                            port_dict['status'] == const.PORT_STATUS_ACTIVE)
1102 1102
         if not port_valid_state:
1103 1103
             return
1104 1104
         fips = l3_obj.FloatingIP.get_objects(

+ 2
- 2
neutron/db/l3_dvrscheduler_db.py View File

@@ -125,7 +125,7 @@ class L3_DVRsch_db_mixin(l3agent_sch_db.L3AgentSchedulerDbMixin):
125 125
             for agent in snat_agent_list:
126 126
                 LOG.debug('DVR: Handle new unbound migration port, '
127 127
                           'host %(host)s, router_ids %(router_ids)s',
128
-                    {'host': agent.host, 'router_ids': router_ids})
128
+                          {'host': agent.host, 'router_ids': router_ids})
129 129
                 self.l3_rpc_notifier.routers_updated_on_host(
130 130
                     context, router_ids, agent.host)
131 131
                 if agent.host == port_host:
@@ -400,7 +400,7 @@ class L3_DVRsch_db_mixin(l3agent_sch_db.L3AgentSchedulerDbMixin):
400 400
 
401 401
     def _get_router_ids_for_agent(self, context, agent_db, router_ids):
402 402
         result_set = set(super(L3_DVRsch_db_mixin,
403
-                            self)._get_router_ids_for_agent(
403
+                               self)._get_router_ids_for_agent(
404 404
             context, agent_db, router_ids))
405 405
         router_ids = set(router_ids or [])
406 406
         if router_ids and result_set == router_ids:

+ 1
- 1
neutron/db/l3_gwmode_db.py View File

@@ -63,7 +63,7 @@ class L3_NAT_dbonly_mixin(l3_db.L3_NAT_dbonly_mixin):
63 63
             old_router = self._make_router_dict(router)
64 64
             router.enable_snat = self._get_enable_snat(info)
65 65
             router_body = {l3_apidef.ROUTER:
66
-                {l3_apidef.EXTERNAL_GW_INFO: info}}
66
+                           {l3_apidef.EXTERNAL_GW_INFO: info}}
67 67
             registry.publish(resources.ROUTER, events.PRECOMMIT_UPDATE, self,
68 68
                              payload=events.DBEventPayload(
69 69
                                  context, request_body=router_body,

+ 13
- 10
neutron/db/l3_hamode_db.py View File

@@ -144,8 +144,8 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
144 144
                         "%(ha_vr_id)d.",
145 145
                         {'router_id': router_id, 'ha_vr_id': allocation.vr_id})
146 146
                     router_body = {l3_apidef.ROUTER:
147
-                            {l3_ext_ha_apidef.HA_INFO: True,
148
-                             'ha_vr_id': allocation.vr_id}}
147
+                                   {l3_ext_ha_apidef.HA_INFO: True,
148
+                                    'ha_vr_id': allocation.vr_id}}
149 149
                     registry.publish(resources.ROUTER, events.PRECOMMIT_UPDATE,
150 150
                                      self, payload=events.DBEventPayload(
151 151
                                          context, request_body=router_body,
@@ -234,9 +234,11 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
234 234
     def get_number_of_agents_for_scheduling(self, context):
235 235
         """Return number of agents on which the router will be scheduled."""
236 236
 
237
-        num_agents = len(self.get_l3_agents(context, active=True,
238
-            filters={'agent_modes': [constants.L3_AGENT_MODE_LEGACY,
239
-                                     constants.L3_AGENT_MODE_DVR_SNAT]}))
237
+        num_agents = len(
238
+            self.get_l3_agents(
239
+                context, active=True,
240
+                filters={'agent_modes': [constants.L3_AGENT_MODE_LEGACY,
241
+                                         constants.L3_AGENT_MODE_DVR_SNAT]}))
240 242
         max_agents = cfg.CONF.max_l3_agents_per_router
241 243
         if max_agents:
242 244
             if max_agents > num_agents:
@@ -257,8 +259,8 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
257 259
                     port_id=port_id,
258 260
                     router_id=router_id,
259 261
                     port_type=constants.DEVICE_OWNER_ROUTER_HA_INTF).create()
260
-                portbinding = l3_hamode.L3HARouterAgentPortBinding(context,
261
-                    port_id=port_id, router_id=router_id)
262
+                portbinding = l3_hamode.L3HARouterAgentPortBinding(
263
+                    context, port_id=port_id, router_id=router_id)
262 264
                 portbinding.create()
263 265
 
264 266
             return portbinding
@@ -671,8 +673,8 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
671 673
             sync_data = self._get_dvr_sync_data(context, host, agent,
672 674
                                                 router_ids, active)
673 675
         else:
674
-            sync_data = super(L3_HA_NAT_db_mixin, self).get_sync_data(context,
675
-                                                            router_ids, active)
676
+            sync_data = super(L3_HA_NAT_db_mixin, self).get_sync_data(
677
+                context, router_ids, active)
676 678
         return self._process_sync_ha_data(
677 679
             context, sync_data, host, dvr_agent_mode)
678 680
 
@@ -703,7 +705,8 @@ class L3_HA_NAT_db_mixin(l3_dvr_db.L3_NAT_with_dvr_db_mixin,
703 705
                           constants.DEVICE_OWNER_ROUTER_SNAT,
704 706
                           constants.DEVICE_OWNER_ROUTER_GW]}
705 707
         ports = self._core_plugin.get_ports(admin_ctx, filters=device_filter)
706
-        active_ports = (port for port in ports
708
+        active_ports = (
709
+            port for port in ports
707 710
             if states[port['device_id']] == n_const.HA_ROUTER_STATE_ACTIVE)
708 711
 
709 712
         for port in active_ports:

+ 6
- 3
neutron/db/migration/alembic_migrations/cisco_init_ops.py View File

@@ -196,7 +196,8 @@ def upgrade():
196 196
         sa.ForeignKeyConstraint(['router_id'], ['routers.id']),
197 197
         sa.PrimaryKeyConstraint('router_id'))
198 198
 
199
-    op.create_table('cisco_hosting_devices',
199
+    op.create_table(
200
+        'cisco_hosting_devices',
200 201
         sa.Column('tenant_id', sa.String(length=255), nullable=True,
201 202
                   index=True),
202 203
         sa.Column('id', sa.String(length=36), nullable=False),
@@ -213,7 +214,8 @@ def upgrade():
213 214
                                 ondelete='SET NULL'),
214 215
         sa.PrimaryKeyConstraint('id')
215 216
     )
216
-    op.create_table('cisco_port_mappings',
217
+    op.create_table(
218
+        'cisco_port_mappings',
217 219
         sa.Column('logical_resource_id', sa.String(length=36), nullable=False),
218 220
         sa.Column('logical_port_id', sa.String(length=36), nullable=False),
219 221
         sa.Column('port_type', sa.String(length=32), nullable=True),
@@ -227,7 +229,8 @@ def upgrade():
227 229
                                 ondelete='CASCADE'),
228 230
         sa.PrimaryKeyConstraint('logical_resource_id', 'logical_port_id')
229 231
     )
230
-    op.create_table('cisco_router_mappings',
232
+    op.create_table(
233
+        'cisco_router_mappings',
231 234
         sa.Column('router_id', sa.String(length=36), nullable=False),
232 235
         sa.Column('auto_schedule', sa.Boolean(), nullable=False),
233 236
         sa.Column('hosting_device_id', sa.String(length=36), nullable=True),

+ 2
- 2
neutron/db/migration/alembic_migrations/core_init_ops.py View File

@@ -138,7 +138,7 @@ def upgrade():
138 138
         sa.Column('network_id', sa.String(length=36), nullable=False),
139 139
         sa.Column('dhcp_agent_id', sa.String(length=36), nullable=False),
140 140
         sa.ForeignKeyConstraint(['dhcp_agent_id'], ['agents.id'],
141
-            ondelete='CASCADE'),
141
+                                ondelete='CASCADE'),
142 142
         sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
143
-            ondelete='CASCADE'),
143
+                                ondelete='CASCADE'),
144 144
         sa.PrimaryKeyConstraint('network_id', 'dhcp_agent_id'))

+ 1
- 1
neutron/db/migration/alembic_migrations/versions/newton/contract/2e0d7a8a1586_add_binding_index_to_routerl3agentbinding.py View File

@@ -46,7 +46,7 @@ def contract_creation_exceptions():
46 46
 def upgrade():
47 47
     op.add_column(ROUTER_L3_AGENT_BINDING,
48 48
                   sa.Column('binding_index', sa.Integer(), nullable=False,
49
-                           server_default='1'))
49
+                            server_default='1'))
50 50
 
51 51
     bindings_table = sa.Table(
52 52
         ROUTER_L3_AGENT_BINDING,

+ 1
- 1
neutron/db/migration/alembic_migrations/versions/newton/contract/c879c5e1ee90_add_segment_id_to_subnet.py View File

@@ -25,7 +25,7 @@ down_revision = '89ab9a816d70'
25 25
 
26 26
 def upgrade():
27 27
     op.add_column('subnets',
28
-        sa.Column('segment_id', sa.String(length=36), nullable=True))
28
+                  sa.Column('segment_id', sa.String(length=36), nullable=True))
29 29
     op.create_foreign_key(
30 30
         None, 'subnets', 'networksegments', ['segment_id'], ['id'])
31 31
 

+ 2
- 1
neutron/db/migration/alembic_migrations/versions/newton/expand/0f5bef0f87d4_add_qos_minimum_bandwidth_rules.py View File

@@ -43,6 +43,7 @@ def upgrade():
43 43
                                        constants.INGRESS_DIRECTION,
44 44
                                        name='directions'),
45 45
                   nullable=False, server_default=constants.EGRESS_DIRECTION),
46
-        sa.UniqueConstraint('qos_policy_id', 'direction',
46
+        sa.UniqueConstraint(
47
+            'qos_policy_id', 'direction',
47 48
             name='qos_minimum_bandwidth_rules0qos_policy_id0direction')
48 49
     )

+ 6
- 3
neutron/db/migration/alembic_migrations/versions/newton/expand/5abc0278ca73_add_support_for_vlan_trunking.py View File

@@ -22,7 +22,8 @@ down_revision = '45f8dd33480b'
22 22
 
23 23
 
24 24
 def upgrade():
25
-    op.create_table('trunks',
25
+    op.create_table(
26
+        'trunks',
26 27
         sa.Column('admin_state_up', sa.Boolean(),
27 28
                   nullable=False, server_default=sql.true()),
28 29
         sa.Column('tenant_id', sa.String(length=255), nullable=True,
@@ -42,7 +43,8 @@ def upgrade():
42 43
         sa.UniqueConstraint('port_id'),
43 44
         sa.UniqueConstraint('standard_attr_id')
44 45
     )
45
-    op.create_table('subports',
46
+    op.create_table(
47
+        'subports',
46 48
         sa.Column('port_id', sa.String(length=36)),
47 49
         sa.Column('trunk_id', sa.String(length=36), nullable=False),
48 50
         sa.Column('segmentation_type', sa.String(length=32), nullable=False),
@@ -51,6 +53,7 @@ def upgrade():
51 53
         sa.ForeignKeyConstraint(['trunk_id'], ['trunks.id'],
52 54
                                 ondelete='CASCADE'),
53 55
         sa.PrimaryKeyConstraint('port_id'),
54
-        sa.UniqueConstraint('trunk_id', 'segmentation_type', 'segmentation_id',
56
+        sa.UniqueConstraint(
57
+            'trunk_id', 'segmentation_type', 'segmentation_id',
55 58
             name='uniq_subport0trunk_id0segmentation_type0segmentation_id')
56 59
     )

+ 2
- 1
neutron/db/migration/alembic_migrations/versions/newton/expand/a5648cfeeadf_add_subnet_service_types.py View File

@@ -30,7 +30,8 @@ down_revision = '030a959ceafa'
30 30
 
31 31
 
32 32
 def upgrade():
33
-    op.create_table('subnet_service_types',
33
+    op.create_table(
34
+        'subnet_service_types',
34 35
         sa.Column('subnet_id', sa.String(length=36)),
35 36
         sa.Column('service_type', sa.String(length=255)),
36 37
         sa.ForeignKeyConstraint(['subnet_id'], ['subnets.id'],

+ 4
- 4
neutron/db/migration/alembic_migrations/versions/ocata/expand/a9c43481023c_extend_ml2_port_bindings.py View File

@@ -43,13 +43,13 @@ def upgrade():
43 43
 
44 44
     op.add_column(ML2_PORT_BINDING,
45 45
                   sa.Column('status',
46
-                  sa.String(length=16),
47
-                  nullable=False,
48
-                  server_default=constants.ACTIVE))
46
+                            sa.String(length=16),
47
+                            nullable=False,
48
+                            server_default=constants.ACTIVE))
49 49
 
50 50
     if (engine.name == MYSQL_ENGINE):
51 51
         op.execute("ALTER TABLE ml2_port_bindings DROP PRIMARY KEY,"
52
-                "ADD PRIMARY KEY(port_id, host);")
52
+                   "ADD PRIMARY KEY(port_id, host);")
53 53
     else:
54 54
         inspector = insp.from_engine(bind)
55 55
         pk_constraint = inspector.get_pk_constraint(ML2_PORT_BINDING)

+ 2
- 1
neutron/db/migration/alembic_migrations/versions/stein/expand/9bfad3f1e780_support_shared_security_groups.py View File

@@ -31,7 +31,8 @@ down_revision = '0ff9e3881597'
31 31
 
32 32
 
33 33
 def upgrade():
34
-    op.create_table('securitygrouprbacs',
34
+    op.create_table(
35
+        'securitygrouprbacs',
35 36
         sa.Column('project_id', sa.String(length=255), nullable=True),
36 37
         sa.Column('id', sa.String(length=36), nullable=False),
37 38
         sa.Column('target_tenant', sa.String(length=255), nullable=False),

+ 1
- 1
neutron/db/migration/cli.py View File

@@ -572,7 +572,7 @@ def get_alembic_version_table(config):
572 572
         return []
573 573
 
574 574
     with environment.EnvironmentContext(config, script_dir,
575
-                                       fn=alembic_version_table_from_env):
575
+                                        fn=alembic_version_table_from_env):
576 576
         script_dir.run_env()
577 577
 
578 578
     return alembic_version_table[0]

+ 2
- 1
neutron/db/models/flavor.py View File

@@ -24,7 +24,8 @@ class Flavor(model_base.BASEV2, model_base.HasId):
24 24
     # Make it True for multi-type flavors
25 25
     service_type = sa.Column(sa.String(36), nullable=True)
26 26
     service_profiles = orm.relationship("FlavorServiceProfileBinding",
27
-        cascade="all, delete-orphan", lazy="subquery")
27
+                                        cascade="all, delete-orphan",
28
+                                        lazy="subquery")
28 29
 
29 30
 
30 31
 class ServiceProfile(model_base.BASEV2, model_base.HasId):

+ 1
- 1
neutron/db/models/l3.py View File

@@ -105,7 +105,7 @@ class FloatingIP(standard_attr.HasStandardAttributes, model_base.BASEV2,
105 105
         sa.UniqueConstraint(
106 106
             floating_network_id, fixed_port_id, fixed_ip_address,
107 107
             name=('uniq_floatingips0floatingnetworkid'
108
-                 '0fixedportid0fixedipaddress')),
108
+                  '0fixedportid0fixedipaddress')),
109 109
         model_base.BASEV2.__table_args__,)
110 110
     api_collections = [l3_apidef.FLOATINGIPS]
111 111
     collection_resource_map = {l3_apidef.FLOATINGIPS: l3_apidef.FLOATINGIP}

+ 1
- 1
neutron/db/models/plugins/ml2/geneveallocation.py View File

@@ -21,7 +21,7 @@ class GeneveAllocation(model_base.BASEV2):
21 21
     __tablename__ = 'ml2_geneve_allocations'
22 22
 
23 23
     geneve_vni = sa.Column(sa.Integer, nullable=False, primary_key=True,
24
-                        autoincrement=False)
24
+                           autoincrement=False)
25 25
     allocated = sa.Column(sa.Boolean, nullable=False, default=False,
26 26
                           server_default=sql.false(), index=True)
27 27
 

+ 16
- 13
neutron/db/securitygroups_db.py View File

@@ -188,8 +188,8 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase,
188 188
                                                      fields)
189 189
                 if (fields is None or len(fields) == 0 or
190 190
                    'security_group_rules' in fields):
191
-                    rules = self.get_security_group_rules(context,
192
-                        {'security_group_id': [id]})
191
+                    rules = self.get_security_group_rules(
192
+                        context, {'security_group_id': [id]})
193 193
                     ret['security_group_rules'] = rules
194 194
 
195 195
         finally:
@@ -318,8 +318,8 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase,
318 318
     def _create_port_security_group_binding(self, context, port_id,
319 319
                                             security_group_id):
320 320
         with db_api.CONTEXT_WRITER.using(context):
321
-            db = sg_models.SecurityGroupPortBinding(port_id=port_id,
322
-                                          security_group_id=security_group_id)
321
+            db = sg_models.SecurityGroupPortBinding(
322
+                port_id=port_id, security_group_id=security_group_id)
323 323
             context.session.add(db)
324 324
 
325 325
     def _get_port_security_group_bindings(self, context,
@@ -427,9 +427,10 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase,
427 427
                                                           id=sg_rule.id)
428 428
             res_rule_dict = self._make_security_group_rule_dict(sg_rule.db_obj)
429 429
             kwargs['security_group_rule'] = res_rule_dict
430
-            self._registry_notify(resources.SECURITY_GROUP_RULE,
431
-                              events.PRECOMMIT_CREATE,
432
-                              exc_cls=ext_sg.SecurityGroupConflict, **kwargs)
430
+            self._registry_notify(
431
+                resources.SECURITY_GROUP_RULE,
432
+                events.PRECOMMIT_CREATE,
433
+                exc_cls=ext_sg.SecurityGroupConflict, **kwargs)
433 434
         return res_rule_dict
434 435
 
435 436
     def _get_ip_proto_number(self, protocol):
@@ -478,8 +479,8 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase,
478 479
             if rule['port_range_min'] == 0 or rule['port_range_max'] == 0:
479 480
                 raise ext_sg.SecurityGroupInvalidPortValue(port=0)
480 481
             elif (rule['port_range_min'] is not None and
481
-                rule['port_range_max'] is not None and
482
-                rule['port_range_min'] <= rule['port_range_max']):
482
+                  rule['port_range_max'] is not None and
483
+                  rule['port_range_min'] <= rule['port_range_max']):
483 484
                 pass
484 485
             else:
485 486
                 raise ext_sg.SecurityGroupInvalidPortRange()
@@ -800,10 +801,12 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase,
800 801
 
801 802
         sg_objs = sg_obj.SecurityGroup.get_objects(context, id=port_sg)
802 803
 
803
-        valid_groups = set(g.id for g in sg_objs
804
-            if not tenant_id or g.tenant_id == tenant_id or
805
-            sg_obj.SecurityGroup.is_shared_with_tenant(context,
806
-                                                       g.id, tenant_id))
804
+        valid_groups = set(
805
+            g.id for g in sg_objs
806
+            if (not tenant_id or g.tenant_id == tenant_id or
807
+                sg_obj.SecurityGroup.is_shared_with_tenant(
808
+                    context, g.id, tenant_id))
809
+        )
807 810
 
808 811
         requested_groups = set(port_sg)
809 812
         port_sg_missing = requested_groups - valid_groups

+ 6
- 6
neutron/db/servicetype_db.py View File

@@ -44,11 +44,10 @@ class ServiceTypeManager(object):
44 44
 
45 45
     def get_service_providers(self, context, filters=None, fields=None):
46 46
         if filters and 'service_type' in filters:
47
-            return list(
48
-                chain.from_iterable(self.config[svc_type].
49
-                                    get_service_providers(filters, fields)
50
-                    for svc_type in filters['service_type']
51
-                        if svc_type in self.config)
47
+            return list(chain.from_iterable(
48
+                self.config[svc_type].get_service_providers(filters, fields)
49
+                for svc_type in filters['service_type']
50
+                if svc_type in self.config)
52 51
             )
53 52
         return list(
54 53
             chain.from_iterable(
@@ -76,7 +75,8 @@ class ServiceTypeManager(object):
76 75
     def add_resource_association(self, context, service_type, provider_name,
77 76
                                  resource_id):
78 77
         r = self.get_service_providers(context,
79
-            filters={'service_type': [service_type], 'name': [provider_name]})
78
+                                       filters={'service_type': [service_type],
79
+                                                'name': [provider_name]})
80 80
         if not r:
81 81
             raise pconf.ServiceProviderNotFound(provider=provider_name,
82 82
                                                 service_type=service_type)

+ 2
- 1
neutron/db/uplink_status_propagation_db.py View File

@@ -20,7 +20,8 @@ class UplinkStatusPropagationMixin(object):
20 20
     """Mixin class to add uplink propagation to a port"""
21 21
 
22 22
     def _process_create_port(self, context, data, res):
23
-        obj = usp_obj.PortUplinkStatusPropagation(context, port_id=res['id'],
23
+        obj = usp_obj.PortUplinkStatusPropagation(
24
+            context, port_id=res['id'],
24 25
             propagate_uplink_status=data[usp.PROPAGATE_UPLINK_STATUS])
25 26
         obj.create()
26 27
         res[usp.PROPAGATE_UPLINK_STATUS] = data[usp.PROPAGATE_UPLINK_STATUS]

+ 7
- 6
neutron/extensions/subnet_service_types.py View File

@@ -58,12 +58,13 @@ validators.add_validator('type:validate_subnet_service_types',
58 58
 
59 59
 EXTENDED_ATTRIBUTES_2_0 = {
60 60
     subnet_def.COLLECTION_NAME: {
61
-        'service_types': {'allow_post': True,
62
-                          'allow_put': True,
63
-                          'default': constants.ATTR_NOT_SPECIFIED,
64
-                          'validate': {'type:validate_subnet_service_types':
65
-                                      None},
66
-                          'is_visible': True, },
61
+        'service_types': {
62
+            'allow_post': True,
63
+            'allow_put': True,
64
+            'default': constants.ATTR_NOT_SPECIFIED,
65
+            'validate': {'type:validate_subnet_service_types': None},
66
+            'is_visible': True,
67
+        },
67 68
     },
68 69
 }
69 70
 

+ 2
- 2
neutron/ipam/drivers/neutrondb_ipam/db_api.py View File

@@ -64,8 +64,8 @@ class IpamSubnetManager(object):
64 64
         :param context: neutron api request context
65 65
         :param neutron_subnet_id: neutron subnet id associated with ipam subnet
66 66
         """
67
-        return ipam_objs.IpamSubnet.delete_objects(context,
68
-             neutron_subnet_id=neutron_subnet_id)
67
+        return ipam_objs.IpamSubnet.delete_objects(
68
+             context, neutron_subnet_id=neutron_subnet_id)
69 69
 
70 70
     def create_pool(self, context, pool_start, pool_end):
71 71
         """Create an allocation pool for the subnet.

+ 2
- 2
neutron/ipam/drivers/neutrondb_ipam/driver.py View File

@@ -187,8 +187,8 @@ class NeutronDbSubnet(ipam_base.Subnet):
187 187
                 allocated_num_addresses = requested_num_addresses
188 188
 
189 189
             if prefer_next:
190
-                allocated_ip_pool = list(itertools.islice(av_set,
191
-                    allocated_num_addresses))
190
+                allocated_ip_pool = list(itertools.islice(
191
+                    av_set, allocated_num_addresses))
192 192
                 allocated_ips.extend([str(allocated_ip)
193 193
                                       for allocated_ip in allocated_ip_pool])
194 194
 

+ 11
- 11
neutron/ipam/subnet_alloc.py View File

@@ -313,8 +313,8 @@ class SubnetPoolReader(object):
313 313
         self._sp_helper.validate_max_prefixlen(self.max_prefixlen,
314 314
                                                ip_version)
315 315
         self._sp_helper.validate_default_prefixlen(self.min_prefixlen,
316
-                                                self.max_prefixlen,
317
-                                                self.default_prefixlen)
316
+                                                   self.max_prefixlen,
317
+                                                   self.default_prefixlen)
318 318
 
319 319
     def _read_prefix_bound(self, type, subnetpool, default_bound=None):
320 320
         prefixlen_attr = type + '_prefixlen'
@@ -372,15 +372,15 @@ class SubnetPoolReader(object):
372 372
 class SubnetPoolHelper(object):
373 373
 
374 374
     _PREFIX_VERSION_INFO = {4: {'max_prefixlen': constants.IPv4_BITS,
375
-                               'wildcard': '0.0.0.0',
376
-                               'default_min_prefixlen': 8,
377
-                               # IPv4 quota measured in units of /32
378
-                               'quota_units': 32},
379
-                           6: {'max_prefixlen': constants.IPv6_BITS,
380
-                               'wildcard': '::',
381
-                               'default_min_prefixlen': 64,
382
-                               # IPv6 quota measured in units of /64
383
-                               'quota_units': 64}}
375
+                                'wildcard': '0.0.0.0',
376
+                                'default_min_prefixlen': 8,
377
+                                # IPv4 quota measured in units of /32
378
+                                'quota_units': 32},
379
+                            6: {'max_prefixlen': constants.IPv6_BITS,
380
+                                'wildcard': '::',
381
+                                'default_min_prefixlen': 64,
382
+                                # IPv6 quota measured in units of /64
383
+                                'quota_units': 64}}
384 384
 
385 385
     def validate_min_prefixlen(self, min_prefixlen, max_prefixlen):
386 386
         if min_prefixlen < 0:

+ 1
- 1
neutron/objects/l3agent.py View File

@@ -62,5 +62,5 @@ class RouterL3AgentBinding(base.NeutronDbObject):
62 62
                      l3_attrs.RouterExtraAttributes.ha == sql.false(),
63 63
                      l3_attrs.RouterExtraAttributes.ha == sql.null())))
64 64
         bindings = [cls._load_object(context, db_obj) for db_obj in
65
-                query.all()]
65
+                    query.all()]
66 66
         return bindings

+ 2
- 2
neutron/objects/network.py View File

@@ -292,8 +292,8 @@ class Network(rbac_db.NeutronRbacObject):
292 292
     def _set_dns_domain(self, dns_domain):
293 293
         NetworkDNSDomain.delete_objects(self.obj_context, network_id=self.id)
294 294
         if dns_domain:
295
-            NetworkDNSDomain(self.obj_context,
296
-                network_id=self.id, dns_domain=dns_domain).create()
295
+            NetworkDNSDomain(self.obj_context, network_id=self.id,
296
+                             dns_domain=dns_domain).create()
297 297
         self.dns_domain = dns_domain
298 298
         self.obj_reset_changes(['dns_domain'])
299 299
 

+ 7
- 7
neutron/objects/ports.py View File

@@ -198,14 +198,14 @@ class IPAllocation(base.NeutronDbObject):
198 198
         # incorrect results
199 199
         if exclude:
200 200
             alloc_db = (context.session.query(models_v2.IPAllocation).
201
-                       filter_by(subnet_id=subnet_id).join(models_v2.Port).
202
-                       filter(~models_v2.Port.device_owner.
203
-                       in_(device_owner)).first())
201
+                        filter_by(subnet_id=subnet_id).join(models_v2.Port).
202
+                        filter(~models_v2.Port.device_owner.
203
+                        in_(device_owner)).first())
204 204
         else:
205 205
             alloc_db = (context.session.query(models_v2.IPAllocation).
206
-                       filter_by(subnet_id=subnet_id).join(models_v2.Port).
207
-                       filter(models_v2.Port.device_owner.
208
-                       in_(device_owner)).first())
206
+                        filter_by(subnet_id=subnet_id).join(models_v2.Port).
207
+                        filter(models_v2.Port.device_owner.
208
+                        in_(device_owner)).first())
209 209
         if exclude and alloc_db:
210 210
             return super(IPAllocation, cls)._load_object(context, alloc_db)
211 211
         if alloc_db:
@@ -511,7 +511,7 @@ class Port(base.NeutronDbObject):
511 511
 
512 512
     @classmethod
513 513
     def get_ports_ids_by_security_groups(cls, context, security_group_ids,
514
-            excluded_device_owners=None):
514
+                                         excluded_device_owners=None):
515 515
         query = context.session.query(sg_models.SecurityGroupPortBinding)
516 516
         query = query.filter(
517 517
             sg_models.SecurityGroupPortBinding.security_group_id.in_(

+ 6
- 3
neutron/objects/router.py View File

@@ -279,13 +279,16 @@ class FloatingIP(base.NeutronDbObject):
279 279
     def get_scoped_floating_ips(cls, context, router_ids):
280 280
         query = context.session.query(l3.FloatingIP,
281 281
                                       models_v2.SubnetPool.address_scope_id)
282
-        query = query.join(models_v2.Port,
282
+        query = query.join(
283
+            models_v2.Port,
283 284
             l3.FloatingIP.fixed_port_id == models_v2.Port.id)
284 285
         # Outer join of Subnet can cause each ip to have more than one row.
285
-        query = query.outerjoin(models_v2.Subnet,
286
+        query = query.outerjoin(
287
+            models_v2.Subnet,
286 288
             models_v2.Subnet.network_id == models_v2.Port.network_id)
287 289
         query = query.filter(models_v2.Subnet.ip_version == 4)
288
-        query = query.outerjoin(models_v2.SubnetPool,
290
+        query = query.outerjoin(
291
+            models_v2.SubnetPool,
289 292
             models_v2.Subnet.subnetpool_id == models_v2.SubnetPool.id)
290 293
 
291 294
         # Filter out on router_ids

+ 8
- 4
neutron/objects/tag.py View File

@@ -60,19 +60,22 @@ def _apply_tag_filters(model, query, filters):
60 60
     if 'tags' in filters:
61 61
         tags = _get_tag_list(filters.pop('tags'))
62 62
         first_tag = tags.pop(0)
63
-        query = query.join(tag_model.Tag,
63
+        query = query.join(
64
+            tag_model.Tag,
64 65
             model.standard_attr_id == tag_model.Tag.standard_attr_id)
65 66
         query = query.filter(tag_model.Tag.tag == first_tag)
66 67
 
67 68
         for tag in tags:
68 69
             tag_alias = aliased(tag_model.Tag)
69
-            query = query.join(tag_alias,
70
+            query = query.join(
71
+                tag_alias,
70 72
                 model.standard_attr_id == tag_alias.standard_attr_id)
71 73
             query = query.filter(tag_alias.tag == tag)
72 74
 
73 75
     if 'tags-any' in filters:
74 76
         tags = _get_tag_list(filters.pop('tags-any'))
75
-        query = query.join(tag_model.Tag,
77
+        query = query.join(
78
+            tag_model.Tag,
76 79
             model.standard_attr_id == tag_model.Tag.standard_attr_id)
77 80
         query = query.filter(tag_model.Tag.tag.in_(tags))
78 81
 
@@ -84,7 +87,8 @@ def _apply_tag_filters(model, query, filters):
84 87
 
85 88
         for tag in tags:
86 89
             tag_alias = aliased(tag_model.Tag)
87
-            subq = subq.join(tag_alias,
90
+            subq = subq.join(
91
+                tag_alias,
88 92
                 tag_model.Tag.standard_attr_id == tag_alias.standard_attr_id)
89 93
             subq = subq.filter(tag_alias.tag == tag)
90 94
 

+ 1
- 1
neutron/pecan_wsgi/hooks/context.py View File

@@ -23,5 +23,5 @@ class ContextHook(hooks.PecanHook):
23 23
 
24 24
     def before(self, state):
25 25
         ctx = (state.request.environ.get('neutron.context') or
26
-            context.get_admin_context())
26
+               context.get_admin_context())
27 27
         state.request.context['neutron_context'] = ctx

+ 2
- 2
neutron/pecan_wsgi/hooks/translation.py View File

@@ -29,8 +29,8 @@ class ExceptionTranslationHook(hooks.PecanHook):
29 29
         language = None
30 30
         if state.request.accept_language:
31 31
             all_languages = oslo_i18n.get_available_languages('neutron')
32
-            language = state.request.accept_language.lookup(all_languages,
33
-                default='fake_LANG')
32
+            language = state.request.accept_language.lookup(
33
+                all_languages, default='fake_LANG')
34 34
             if language == 'fake_LANG':
35 35
                 language = None
36 36
         exc = api_common.convert_exception_to_http_exc(e, faults.FAULT_MAP,

+ 2
- 1
neutron/plugins/ml2/db.py View File

@@ -264,7 +264,8 @@ def generate_distributed_port_status(context, port_id):
264 264
 
265 265
 def get_distributed_port_binding_by_host(context, port_id, host):
266 266
     with db_api.CONTEXT_READER.using(context):
267
-        binding = (context.session.query(models.DistributedPortBinding).
267
+        binding = (
268
+            context.session.query(models.DistributedPortBinding).
268 269
             filter(models.DistributedPortBinding.port_id.startswith(port_id),
269 270
                    models.DistributedPortBinding.host == host).first())
270 271
     if not binding:

+ 2
- 2
neutron/plugins/ml2/drivers/helpers.py View File

@@ -152,8 +152,8 @@ class SegmentTypeDriver(BaseTypeDriver):
152 152
                         if count:
153 153
                             LOG.debug("%(type)s segment %(segment)s allocate "
154 154
                                       "done ",
155
-                                  {"type": network_type,
156
-                                   "segment": raw_segment})
155
+                                      {"type": network_type,
156
+                                       "segment": raw_segment})
157 157
                             return alloc
158 158
 
159 159
                         # Segment allocated or deleted since select

+ 4
- 2
neutron/plugins/ml2/drivers/l2pop/db.py View File

@@ -74,7 +74,8 @@ def get_agent_by_host(context, agent_host):
74 74
 def _get_active_network_ports(context, network_id):
75 75
     query = context.session.query(ml2_models.PortBinding,
76 76
                                   agent_model.Agent)
77
-    query = query.join(agent_model.Agent,
77
+    query = query.join(
78
+        agent_model.Agent,
78 79
         agent_model.Agent.host == ml2_models.PortBinding.host)
79 80
     query = query.join(models_v2.Port)
80 81
     query = query.options(orm.subqueryload(ml2_models.PortBinding.port))
@@ -85,7 +86,8 @@ def _get_active_network_ports(context, network_id):
85 86
 
86 87
 def _ha_router_interfaces_on_network_query(context, network_id):
87 88
     query = context.session.query(models_v2.Port)
88
-    query = query.join(l3ha_model.L3HARouterAgentPortBinding,
89
+    query = query.join(
90
+        l3ha_model.L3HARouterAgentPortBinding,
89 91
         l3ha_model.L3HARouterAgentPortBinding.router_id ==
90 92
         models_v2.Port.device_id)
91 93
     return query.filter(

+ 1
- 1
neutron/plugins/ml2/drivers/l2pop/mech_driver.py View File

@@ -90,7 +90,7 @@ class L2populationMechanismDriver(api.MechanismDriver):
90 90
             fdb_entries[network_id]['ports'] = other_fdb_ports
91 91
 
92 92
         self.L2populationAgentNotify.remove_fdb_entries(self.rpc_ctx,
93
-            fdb_entries)
93
+                                                        fdb_entries)
94 94
 
95 95
     def filter_hosts_with_segment_access(
96 96
             self, context, segments, candidate_hosts, agent_getter):

+ 3
- 2
neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py View File

@@ -522,8 +522,9 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase):
522 522
                     ctx.reraise = False
523 523
                     return False
524 524
 
525
-    def _add_tap_interface(self, network_id, network_type, physical_network,
526
-                          segmentation_id, tap_device_name, device_owner, mtu):
525
+    def _add_tap_interface(self, network_id,
526
+                           network_type, physical_network, segmentation_id,
527
+                           tap_device_name, device_owner, mtu):
527 528
         """Add tap interface.
528 529
 
529 530
         If a VIF has been plugged into a network, this function will

+ 6
- 3
neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py View File

@@ -380,7 +380,8 @@ class ESwitchManager(object):
380 380
 
381 381
         # We don't know about this device at the moment, so add to the map.
382 382
         if PciOsWrapper.pf_device_exists(dev_name):
383
-            self._create_emb_switch(phys_net, dev_name,
383
+            self._create_emb_switch(
384
+                phys_net, dev_name,
384 385
                 exclude_devices.get(dev_name, set()))
385 386
 
386 387
     def discover_devices(self, device_mappings, exclude_devices):
@@ -426,7 +427,8 @@ class ESwitchManager(object):
426 427
         Clear the "rate" configuration from VF by setting it to 0.
427 428
         @param pci_slot: VF PCI slot
428 429
         """
429
-        self._clear_rate(pci_slot,
430
+        self._clear_rate(
431
+            pci_slot,
430 432
             ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_RATE)
431 433
 
432 434
     def clear_min_tx_rate(self, pci_slot):
@@ -435,7 +437,8 @@ class ESwitchManager(object):
435 437
         Clear the "min_tx_rate" configuration from VF by setting it to 0.
436 438
         @param pci_slot: VF PCI slot
437 439
         """
438
-        self._clear_rate(pci_slot,
440
+        self._clear_rate(
441
+            pci_slot,
439 442
             ip_link_support.IpLinkConstants.IP_LINK_CAPABILITY_MIN_TX_RATE)
440 443
 
441 444
     def _clear_rate(self, pci_slot, rate_type):

+ 2
- 2
neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py View File

@@ -153,8 +153,8 @@ class SriovNicSwitchAgent(object):
153 153
         self.context = context.get_admin_context_without_session()
154 154
         self.plugin_rpc = agent_rpc.PluginApi(topics.PLUGIN)
155 155
         self.sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN)
156
-        self.sg_agent = agent_sg_rpc.SecurityGroupAgentRpc(self.context,
157
-                self.sg_plugin_rpc)
156
+        self.sg_agent = agent_sg_rpc.SecurityGroupAgentRpc(
157
+            self.context, self.sg_plugin_rpc)
158 158
         self._setup_rpc()
159 159
         self.ext_manager = self._create_agent_extension_manager(
160 160
             self.connection)

+ 8
- 8
neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_dvr_process.py View File

@@ -35,16 +35,16 @@ class OVSDVRProcessMixin(object):
35 35
     def install_dvr_process_ipv4(self, vlan_tag, gateway_ip):
36 36
         # block ARP
37 37
         (_dp, ofp, ofpp) = self._get_dp()
38
-        match = self._dvr_process_ipv4_match(ofp, ofpp,
39
-            vlan_tag=vlan_tag, gateway_ip=gateway_ip)
38
+        match = self._dvr_process_ipv4_match(ofp, ofpp, vlan_tag=vlan_tag,
39
+                                             gateway_ip=gateway_ip)
40 40
         self.install_drop(table_id=self.dvr_process_table_id,
41 41
                           priority=3,
42 42
                           match=match)
43 43
 
44 44
     def delete_dvr_process_ipv4(self, vlan_tag, gateway_ip):
45 45
         (_dp, ofp, ofpp) = self._get_dp()
46
-        match = self._dvr_process_ipv4_match(ofp, ofpp,
47
-            vlan_tag=vlan_tag, gateway_ip=gateway_ip)
46
+        match = self._dvr_process_ipv4_match(ofp, ofpp, vlan_tag=vlan_tag,
47
+                                             gateway_ip=gateway_ip)
48 48
         self.uninstall_flows(table_id=self.dvr_process_table_id,
49 49
                              match=match)
50 50
 
@@ -59,15 +59,15 @@ class OVSDVRProcessMixin(object):
59 59
     def install_dvr_process_ipv6(self, vlan_tag, gateway_mac):
60 60
         # block RA
61 61
         (_dp, ofp, ofpp) = self._get_dp()
62
-        match = self._dvr_process_ipv6_match(ofp, ofpp,
63
-            vlan_tag=vlan_tag, gateway_mac=gateway_mac)
62
+        match = self._dvr_process_ipv6_match(ofp, ofpp, vlan_tag=vlan_tag,
63
+                                             gateway_mac=gateway_mac)
64 64
         self.install_drop(table_id=self.dvr_process_table_id, priority=3,
65 65
                           match=match)
66 66
 
67 67
     def delete_dvr_process_ipv6(self, vlan_tag, gateway_mac):
68 68
         (_dp, ofp, ofpp) = self._get_dp()
69
-        match = self._dvr_process_ipv6_match(ofp, ofpp,
70
-            vlan_tag=vlan_tag, gateway_mac=gateway_mac)
69
+        match = self._dvr_process_ipv6_match(ofp, ofpp, vlan_tag=vlan_tag,
70
+                                             gateway_mac=gateway_mac)
71 71
         self.uninstall_flows(table_id=self.dvr_process_table_id,
72 72
                              match=match)
73 73
 

+ 3
- 2
neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_phys.py View File

@@ -58,9 +58,10 @@ class OVSPhysicalBridge(ovs_bridge.OVSAgentBridge,
58 58
 
59 59
     def add_dvr_mac_vlan(self, mac, port):
60 60
         self.install_output(table_id=constants.DVR_NOT_LEARN_VLAN,
61
-            priority=2, eth_src=mac, port=port)
61
+                            priority=2, eth_src=mac, port=port)
62 62
 
63 63
     def remove_dvr_mac_vlan(self, mac):
64 64
         # REVISIT(yamamoto): match in_port as well?
65
-        self.uninstall_flows(table_id=constants.DVR_NOT_LEARN_VLAN,
65
+        self.uninstall_flows(
66
+            table_id=constants.DVR_NOT_LEARN_VLAN,
66 67
             eth_src=mac)

+ 1
- 1
neutron/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/br_phys.py View File

@@ -52,7 +52,7 @@ class OVSPhysicalBridge(ovs_bridge.OVSAgentBridge,
52 52
 
53 53
     def add_dvr_mac_vlan(self, mac, port):
54 54
         self.install_output(table_id=constants.DVR_NOT_LEARN_VLAN,
55
-            priority=2, eth_src=mac, port=port)
55
+                            priority=2, eth_src=mac, port=port)
56 56
 
57 57
     def remove_dvr_mac_vlan(self, mac):
58 58
         # REVISIT(yamamoto): match in_port as well?

+ 3
- 3
neutron/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/br_tun.py View File

@@ -68,7 +68,7 @@ class OVSTunnelBridge(ovs_bridge.OVSAgentBridge,
68 68
                                      proto='arp',
69 69
                                      dl_dst="ff:ff:ff:ff:ff:ff",
70 70
                                      actions=("resubmit(,%s)" %
71
-                                       constants.ARP_RESPONDER))
71
+                                              constants.ARP_RESPONDER))
72 72
 
73 73
             # PATCH_LV_TO_TUN table will handle packets coming from patch_int
74 74
             # unicasts go to table UCAST_TO_TUN where remote addresses are
@@ -77,7 +77,7 @@ class OVSTunnelBridge(ovs_bridge.OVSAgentBridge,
77 77
                                  priority=0,
78 78
                                  dl_dst="00:00:00:00:00:00/01:00:00:00:00:00",
79 79
                                  actions=("resubmit(,%s)" %
80
-                                   constants.UCAST_TO_TUN))
80
+                                          constants.UCAST_TO_TUN))
81 81
 
82 82
             # Broadcasts/multicasts go to table FLOOD_TO_TUN that handles
83 83
             # flooding
@@ -85,7 +85,7 @@ class OVSTunnelBridge(ovs_bridge.OVSAgentBridge,
85 85
                                  priority=0,
86 86
                                  dl_dst="01:00:00:00:00:00/01:00:00:00:00:00",
87 87
                                  actions=("resubmit(,%s)" %
88
-                                   constants.FLOOD_TO_TUN))
88
+                                          constants.FLOOD_TO_TUN))
89 89
 
90 90
             # Tables [tunnel_type]_TUN_TO_LV will set lvid depending on tun_id
91 91
             # for each tunnel type, and resubmit to table LEARN_FROM_TUN where

+ 2
- 2
neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py View File

@@ -193,7 +193,7 @@ class OVSDVRNeutronAgent(object):
193 193
                           "plugin: %r", details)
194 194
                 self.dvr_mac_address = (
195 195
                     netaddr.EUI(details['mac_address'],
196
-                    dialect=netaddr.mac_unix_expanded))
196
+                                dialect=netaddr.mac_unix_expanded))
197 197
                 return
198 198
 
199 199
     def setup_dvr_flows_on_integ_br(self):
@@ -396,7 +396,7 @@ class OVSDVRNeutronAgent(object):
396 396
                 # the compute port is discovered first here that its on
397 397
                 # a dvr routed subnet queue this subnet to that port
398 398
                 comp_ovsport = OVSPort(vif.vif_id, vif.ofport,
399
-                                  vif.vif_mac, local_port['device_owner'])
399
+                                       vif.vif_mac, local_port['device_owner'])
400 400
                 comp_ovsport.add_subnet(subnet_uuid)
401 401
                 self.local_ports[vif.vif_id] = comp_ovsport
402 402
             # create rule for just this vm port

+ 15
- 15
neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py View File

@@ -948,7 +948,7 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
948 948
                 self.context, devices_up, devices_down, self.agent_id,
949 949
                 self.conf.host)
950 950
             failed_devices = (devices_set.get('failed_devices_up') +
951
-                devices_set.get('failed_devices_down'))
951
+                              devices_set.get('failed_devices_down'))
952 952
             if failed_devices:
953 953
                 LOG.error("Configuration for devices %s failed!",
954 954
                           failed_devices)
@@ -995,8 +995,8 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
995 995
             # Install protection only when prefix is not zero because a /0
996 996
             # prefix allows any address anyway and the nd_target can only
997 997
             # match on /1 or more.
998
-            bridge.install_icmpv6_na_spoofing_protection(port=vif.ofport,
999
-                ip_addresses=ipv6_addresses)
998
+            bridge.install_icmpv6_na_spoofing_protection(
999
+                port=vif.ofport, ip_addresses=ipv6_addresses)
1000 1000
 
1001 1001
         ipv4_addresses = {ip for ip in addresses
1002 1002
                           if netaddr.IPNetwork(ip).version == 4}
@@ -1222,8 +1222,8 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
1222 1222
             # be same, so check only one of them.
1223 1223
             # Not logging error here, as the interface may not exist yet.
1224 1224
             # Type check is done to cleanup wrong interface if any.
1225
-            int_type = self.int_br.db_get_val("Interface",
1226
-                int_if_name, "type", log_errors=False)
1225
+            int_type = self.int_br.db_get_val("Interface", int_if_name, "type",
1226
+                                              log_errors=False)
1227 1227
             if self.use_veth_interconnection:
1228 1228
                 # Drop ports if the interface types doesn't match the
1229 1229
                 # configuration value.
@@ -1444,7 +1444,7 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
1444 1444
 
1445 1445
         self._update_port_info_failed_devices_stats(port_info, failed_devices)
1446 1446
         self._update_port_info_failed_devices_stats(ancillary_port_info,
1447
-                                failed_ancillary_devices)
1447
+                                                    failed_ancillary_devices)
1448 1448
 
1449 1449
         if updated_ports is None:
1450 1450
             updated_ports = set()
@@ -1974,9 +1974,9 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
1974 1974
             bridge.cleanup_flows()
1975 1975
 
1976 1976
     def process_port_info(self, start, polling_manager, sync, ovs_restarted,
1977
-                       ports, ancillary_ports, updated_ports_copy,
1978
-                       consecutive_resyncs, ports_not_ready_yet,
1979
-                       failed_devices, failed_ancillary_devices):
1977
+                          ports, ancillary_ports, updated_ports_copy,
1978
+                          consecutive_resyncs, ports_not_ready_yet,
1979
+                          failed_devices, failed_ancillary_devices):
1980 1980
         # There are polling managers that don't have get_events, e.g.
1981 1981
         # AlwaysPoll used by windows implementations
1982 1982
         # REVISIT (rossella_s) This needs to be reworked to hide implementation
@@ -1999,7 +1999,7 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
1999 1999
                 # TODO(rossella_s): For implementations that use AlwaysPoll
2000 2000
                 # resync if a device failed. This can be improved in future
2001 2001
                 sync = (any(failed_devices.values()) or
2002
-                    any(failed_ancillary_devices.values()))
2002
+                        any(failed_ancillary_devices.values()))
2003 2003
 
2004 2004
             # NOTE(rossella_s) don't empty the queue of events
2005 2005
             # calling polling_manager.get_events() since
@@ -2109,9 +2109,9 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
2109 2109
             self._report_state()
2110 2110
         if self.enable_distributed_routing:
2111 2111
             self.dvr_agent.reset_ovs_parameters(self.int_br,
2112
-                                         self.tun_br,
2113
-                                         self.patch_int_ofport,
2114
-                                         self.patch_tun_ofport)
2112
+                                                self.tun_br,
2113
+                                                self.patch_int_ofport,
2114
+                                                self.patch_tun_ofport)
2115 2115
             self.dvr_agent.reset_dvr_parameters()
2116 2116
             self.dvr_agent.setup_dvr_flows()
2117 2117
         # notify that OVS has restarted
@@ -2178,8 +2178,8 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
2178 2178
                     tunnel_sync = True
2179 2179
             ovs_restarted |= (ovs_status == constants.OVS_RESTARTED)
2180 2180
             devices_need_retry = (any(failed_devices.values()) or
2181
-                any(failed_ancillary_devices.values()) or
2182
-                ports_not_ready_yet)
2181
+                                  any(failed_ancillary_devices.values()) or
2182
+                                  ports_not_ready_yet)
2183 2183
             if (self._agent_has_updates(polling_manager) or sync or
2184 2184
                     devices_need_retry):
2185 2185
                 try:

+ 8
- 5
neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py View File

@@ -55,9 +55,11 @@ class OpenvswitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
55 55
 
56 56
     def __init__(self):
57 57
         sg_enabled = securitygroups_rpc.is_firewall_enabled()
58
-        hybrid_plug_required = (not cfg.CONF.SECURITYGROUP.firewall_driver or
58
+        hybrid_plug_required = (
59
+            not cfg.CONF.SECURITYGROUP.firewall_driver or
59 60
             cfg.CONF.SECURITYGROUP.firewall_driver in (
60
-                IPTABLES_FW_DRIVER_FULL, 'iptables_hybrid')) and sg_enabled
61
+                IPTABLES_FW_DRIVER_FULL, 'iptables_hybrid')
62
+        ) and sg_enabled
61 63
         vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
62 64
                        portbindings.OVS_HYBRID_PLUG: hybrid_plug_required}
63 65
         # NOTE(moshele): Bind DIRECT (SR-IOV) port allows
@@ -163,9 +165,10 @@ class OpenvswitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
163 165
         if bridge_name:
164 166
             vif_details[portbindings.VIF_DETAILS_BRIDGE_NAME] = bridge_name
165 167
 
166
-        registry.publish(a_const.OVS_BRIDGE_NAME, events.BEFORE_READ,
167
-            set_bridge_name_inner, payload=events.EventPayload(
168
-                None, metadata={'port': port}))
168
+        registry.publish(
169
+            a_const.OVS_BRIDGE_NAME, events.BEFORE_READ,
170
+            set_bridge_name_inner,
171
+            payload=events.EventPayload(None, metadata={'port': port}))
169 172
 
170 173
     def _pre_get_vif_details(self, agent, context):
171 174
         a_config = agent['configurations']

+ 2
- 2
neutron/plugins/ml2/drivers/type_tunnel.py View File

@@ -550,8 +550,8 @@ class TunnelRpcCallbackMixin(object):
550 550
                         host, ip_endpoint.ip_address)
551 551
                 elif (host_endpoint and host_endpoint.ip_address != tunnel_ip):
552 552
                     # Notify all other listening agents to delete stale tunnels
553
-                    self._notifier.tunnel_delete(rpc_context,
554
-                        host_endpoint.ip_address, tunnel_type)
553
+                    self._notifier.tunnel_delete(
554
+                        rpc_context, host_endpoint.ip_address, tunnel_type)
555 555
                     driver.obj.delete_endpoint(host_endpoint.ip_address)
556 556
 
557 557
             tunnel = driver.obj.add_endpoint(tunnel_ip, host)

+ 7
- 5
neutron/plugins/ml2/extensions/dns_integration.py View File

@@ -139,9 +139,11 @@ class DNSExtensionDriver(api.ExtensionDriver):
139 139
             plugin_context,
140 140
             port_id=db_data['id'])
141 141
         if dns_data_db:
142
-            is_dns_name_changed = (dns_name is not None and
143
-                    dns_data_db[dns_apidef.DNSNAME] != dns_name)
144
-            is_dns_domain_changed = (dns_domain is not None and
142
+            is_dns_name_changed = (
143
+                dns_name is not None and
144
+                dns_data_db[dns_apidef.DNSNAME] != dns_name)
145
+            is_dns_domain_changed = (
146
+                dns_domain is not None and
145 147
                 dns_data_db[dns_apidef.DNSDOMAIN] != dns_domain)
146 148
             if (is_dns_name_changed or is_dns_domain_changed or
147 149
                     (has_fixed_ips and dns_data_db['current_dns_name'])):
@@ -159,8 +161,8 @@ class DNSExtensionDriver(api.ExtensionDriver):
159 161
             dns_data_db.update()
160 162
             return dns_data_db
161 163
         if dns_name or dns_domain:
162
-            dns_data_db = self._create_port_dns_record(plugin_context,
163
-                    request_data, db_data, network, dns_name or '')
164
+            dns_data_db = self._create_port_dns_record(
165
+                plugin_context, request_data, db_data, network, dns_name or '')
164 166
         return dns_data_db
165 167
 
166 168
     def _populate_previous_external_dns_data(self, dns_data_db):

+ 8
- 8
neutron/plugins/ml2/plugin.py View File

@@ -1371,8 +1371,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
1371 1371
         if self._check_update_has_allowed_address_pairs(port):
1372 1372
             #  has address pairs in request
1373 1373
             raise addr_exc.AddressPairAndPortSecurityRequired()
1374
-        elif (not
1375
-         self._check_update_deletes_allowed_address_pairs(port)):
1374
+        elif not self._check_update_deletes_allowed_address_pairs(port):
1376 1375
             # not a request for deleting the address-pairs
1377 1376
             updated_port[addr_apidef.ADDRESS_PAIRS] = (
1378 1377
                     self.get_allowed_address_pairs(context, id))
@@ -1386,8 +1385,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
1386 1385
         # security groups, port security is set
1387 1386
         if self._check_update_has_security_groups(port):
1388 1387
             raise psec_exc.PortSecurityAndIPRequiredForSecurityGroups()
1389
-        elif (not
1390
-          self._check_update_deletes_security_groups(port)):
1388
+        elif not self._check_update_deletes_security_groups(port):
1391 1389
             if not extensions.is_extension_supported(self, 'security-group'):
1392 1390
                 return
1393 1391
             # Update did not have security groups passed in. Check
@@ -1578,7 +1576,8 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
1578 1576
                                                           id, host)
1579 1577
         device_id = attrs and attrs.get('device_id')
1580 1578
         router_id = binding and binding.get('router_id')
1581
-        update_required = (not binding or
1579
+        update_required = (
1580
+            not binding or
1582 1581
             binding.vif_type == portbindings.VIF_TYPE_BINDING_FAILED or
1583 1582
             router_id != device_id)
1584 1583
         if update_required:
@@ -1591,8 +1590,8 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
1591 1590
                     network = self.get_network(context,
1592 1591
                                                orig_port['network_id'])
1593 1592
                     levels = db.get_binding_level_objs(context, id, host)
1594
-                    mech_context = driver_context.PortContext(self,
1595
-                        context, orig_port, network,
1593
+                    mech_context = driver_context.PortContext(
1594
+                        self, context, orig_port, network,
1596 1595
                         binding, levels, original_port=orig_port)
1597 1596
                     self._process_distributed_port_binding(
1598 1597
                         mech_context, context, attrs)
@@ -2059,7 +2058,8 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
2059 2058
         # change in segments could affect resulting network mtu, so let's
2060 2059
         # recalculate it
2061 2060
         network_db = self._get_network(context, network_id)
2062
-        network_db.mtu = self._get_network_mtu(network_db,
2061
+        network_db.mtu = self._get_network_mtu(
2062
+            network_db,
2063 2063
             validate=(event != events.PRECOMMIT_DELETE))
2064 2064
         network_db.save(session=context.session)
2065 2065
 

+ 1
- 1
neutron/privileged/agent/linux/netlink_lib.py View File

@@ -95,7 +95,7 @@ ATTR_POSITIONS = {
95 95
     'icmp': [('type', 6), ('code', 7), ('src', 4), ('dst', 5), ('id', 8),
96 96
              ('zone', 16)],
97 97
     'icmpv6': [('type', 6), ('code', 7), ('src', 4), ('dst', 5), ('id', 8),
98
-             ('zone', 16)],
98
+               ('zone', 16)],
99 99
     'tcp': [('sport', 7), ('dport', 8), ('src', 5), ('dst', 6), ('zone', 15)],
100 100
     'udp': [('sport', 6), ('dport', 7), ('src', 4), ('dst', 5), ('zone', 14)]
101 101
 }

+ 1
- 1
neutron/quota/__init__.py View File

@@ -96,7 +96,7 @@ class ConfDriver(object):
96 96
                  if quotas[key] >= 0 and quotas[key] < val]
97 97
         if overs:
98 98
             raise exceptions.OverQuota(overs=sorted(overs), quotas=quotas,
99
-                                    usages={})
99
+                                       usages={})
100 100
 
101 101
     @staticmethod
102 102
     def get_tenant_quotas(context, resources, tenant_id):

+ 1
- 1
neutron/scheduler/base_scheduler.py View File

@@ -73,5 +73,5 @@ class BaseWeightScheduler(BaseScheduler):
73 73
     def select(self, plugin, context, resource_hostable_agents,
74 74
                resource_hosted_agents, num_agents_needed):
75 75
         chosen_agents = sorted(resource_hostable_agents,
76
-                           key=attrgetter('load'))[0:num_agents_needed]
76
+                               key=attrgetter('load'))[0:num_agents_needed]
77 77
         return chosen_agents

+ 3
- 2
neutron/scheduler/dhcp_agent_scheduler.py View File

@@ -176,8 +176,9 @@ class DhcpFilter(base_resource_filter.BaseResourceFilter):
176 176
             # DetachedInstanceError
177 177
             agent_id = agent.id
178 178
             try:
179
-                network.NetworkDhcpAgentBinding(context,
180
-                     dhcp_agent_id=agent_id, network_id=network_id).create()
179
+                network.NetworkDhcpAgentBinding(
180
+                     context, dhcp_agent_id=agent_id,
181
+                     network_id=network_id).create()
181 182
             except exceptions.NeutronDbObjectDuplicateEntry:
182 183
                 # it's totally ok, someone just did our job!
183 184
                 bound_agents.remove(agent)

+ 7
- 7
neutron/services/auto_allocate/db.py View File

@@ -66,8 +66,8 @@ def _ensure_external_network_default_value_callback(
66 66
         if is_default:
67 67
             # ensure only one default external network at any given time
68 68
             pager = base_obj.Pager(limit=1)
69
-            objs = net_obj.ExternalNetwork.get_objects(context,
70
-                _pager=pager, is_default=True)
69
+            objs = net_obj.ExternalNetwork.get_objects(context, _pager=pager,
70
+                                                       is_default=True)
71 71
             if objs:
72 72
                 if objs[0] and network['id'] != objs[0].network_id:
73 73
                     raise exceptions.DefaultExternalNetworkExists(
@@ -96,9 +96,9 @@ class AutoAllocatedTopologyMixin(common_db_mixin.CommonDbMixin):
96 96
         new = super(AutoAllocatedTopologyMixin, cls).__new__(cls, *args,
97 97
                                                              **kwargs)
98 98
         registry.subscribe(_ensure_external_network_default_value_callback,
99
-            resources.NETWORK, events.PRECOMMIT_UPDATE)
99
+                           resources.NETWORK, events.PRECOMMIT_UPDATE)
100 100
         registry.subscribe(_ensure_external_network_default_value_callback,
101
-            resources.NETWORK, events.PRECOMMIT_CREATE)
101
+                           resources.NETWORK, events.PRECOMMIT_CREATE)
102 102
         return new
103 103
 
104 104
     # TODO(armax): if a tenant modifies auto allocated resources under
@@ -145,7 +145,7 @@ class AutoAllocatedTopologyMixin(common_db_mixin.CommonDbMixin):
145 145
             return self._check_requirements(context, tenant_id)
146 146
         elif fields:
147 147
             raise n_exc.BadRequest(resource='auto_allocate',
148
-                msg=_("Unrecognized field"))
148
+                                   msg=_("Unrecognized field"))
149 149
 
150 150
         # Check for an existent topology
151 151
         network_id = self._get_auto_allocated_network(context, tenant_id)
@@ -335,8 +335,8 @@ class AutoAllocatedTopologyMixin(common_db_mixin.CommonDbMixin):
335 335
                       {'tenant_id': tenant_id, 'reason': e})
336 336
             router_id = router['id'] if router else None
337 337
             self._cleanup(context,
338
-                network_id=subnets[0]['network_id'],
339
-                router_id=router_id, subnets=attached_subnets)
338
+                          network_id=subnets[0]['network_id'],
339
+                          router_id=router_id, subnets=attached_subnets)
340 340
             raise exceptions.AutoAllocationFailure(
341 341
                 reason=_("Unable to provide external connectivity"))
342 342
         except Exception as e:

+ 3
- 2
neutron/services/network_ip_availability/plugin.py View File

@@ -45,8 +45,9 @@ class NetworkIPAvailabilityPlugin(ip_availability_db.IpAvailabilityMixin,
45 45
     def get_network_ip_availabilities(self, context, filters=None,
46 46
                                       fields=None):
47 47
         """Returns ip availability data for a collection of networks."""
48
-        net_ip_availabilities = super(NetworkIPAvailabilityPlugin,
49
-                     self).get_network_ip_availabilities(context, filters)
48
+        net_ip_availabilities = super(
49
+            NetworkIPAvailabilityPlugin, self
50
+        ).get_network_ip_availabilities(context, filters)
50 51
         return [db_utils.resource_fields(net_ip_availability, fields)
51 52
                 for net_ip_availability in net_ip_availabilities]
52 53
 

+ 1
- 1
neutron/services/placement_report/plugin.py View File

@@ -214,7 +214,7 @@ class PlacementReporterAgents(object):
214 214
                 for driver in self._mechanism_drivers
215 215
                 if driver.obj.resource_provider_uuid5_namespace is not None]
216 216
             LOG.debug('agent types supporting placement reports: %s',
217
-                ', '.join(self._supported_agent_types))
217
+                      ', '.join(self._supported_agent_types))
218 218
         return self._supported_agent_types
219 219
 
220 220
     def mechanism_driver_by_agent_type(self, agent_type):

+ 1
- 1
neutron/services/qos/qos_plugin.py View File

@@ -414,7 +414,7 @@ class QoSPlugin(qos.QoSPluginBase):
414 414
 
415 415
     @db_base_plugin_common.convert_result_to_dict
416 416
     def update_policy_rule(self, context, rule_cls, rule_id, policy_id,
417
-            rule_data):
417
+                           rule_data):
418 418
         """Update a QoS policy rule.
419 419
 
420 420
         :param context: neutron api request context

+ 5
- 4
neutron/services/segments/plugin.py View File

@@ -349,7 +349,7 @@ class NovaSegmentNotifier(object):
349 349
                                                 segment_id=current_segment_ids)
350 350
         segment_ids = {s.segment_id for s in subnets}
351 351
         self.batch_notifier.queue_event(Event(self._add_host_to_aggregate,
352
-            segment_ids, host=host))
352
+                                              segment_ids, host=host))
353 353
 
354 354
     def _add_host_to_aggregate(self, event):
355 355
         for segment_id in event.segment_ids:
@@ -379,8 +379,9 @@ class NovaSegmentNotifier(object):
379 379
         if segment_id:
380 380
             if event == events.AFTER_DELETE:
381 381
                 ipv4_subnets_number = -ipv4_subnets_number
382
-            self.batch_notifier.queue_event(Event(self._update_nova_inventory,
383
-                segment_id, reserved=ipv4_subnets_number))
382
+            self.batch_notifier.queue_event(
383
+                Event(self._update_nova_inventory,
384
+                      segment_id, reserved=ipv4_subnets_number))
384 385
 
385 386
     @registry.receives(resources.PORT, [events.AFTER_UPDATE])
386 387
     def _notify_port_updated(self, resource, event, trigger, context,
@@ -407,7 +408,7 @@ class NovaSegmentNotifier(object):
407 408
         update = port_ipv4_subnets_number - original_port_ipv4_subnets_number
408 409
         if update:
409 410
             self.batch_notifier.queue_event(Event(self._update_nova_inventory,
410
-                segment_id, reserved=update))
411
+                                                  segment_id, reserved=update))
411 412
 
412 413
     def _get_ipv4_subnets_number_and_segment_id(self, port, context):
413 414
         ipv4_subnet_ids = self._get_ipv4_subnet_ids(port)

+ 3
- 3
neutron/services/tag/tag_plugin.py View File

@@ -103,7 +103,7 @@ class TagPlugin(common_db_mixin.CommonDbMixin, tagging.TagPluginBase):
103 103
             return
104 104
         try:
105 105
             tag_obj.Tag(context, standard_attr_id=res.standard_attr_id,
106
-                tag=tag).create()
106
+                        tag=tag).create()
107 107
         except obj_exc.NeutronDbObjectDuplicateEntry:
108 108
             pass
109 109
 
@@ -116,6 +116,6 @@ class TagPlugin(common_db_mixin.CommonDbMixin, tagging.TagPluginBase):
116 116
     @log_helpers.log_method_call
117 117
     def delete_tag(self, context, resource, resource_id, tag):
118 118
         res = self._get_resource(context, resource, resource_id)
119
-        if not tag_obj.Tag.delete_objects(context,
120
-            tag=tag, standard_attr_id=res.standard_attr_id):
119
+        if not tag_obj.Tag.delete_objects(
120
+            context, tag=tag, standard_attr_id=res.standard_attr_id):
121 121
             raise tagging.TagNotFound(tag=tag)

+ 1
- 1
neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py View File

@@ -49,7 +49,7 @@ def get_patch_peer_attrs(peer_name, port_mac=None, port_id=None):
49 49
     if port_id:
50 50
         external_ids['iface-id'] = port_id
51 51
     attrs = [('type', 'patch'),
52
-            ('options', {'peer': peer_name})]
52
+             ('options', {'peer': peer_name})]
53 53
     if external_ids:
54 54
         attrs.append(
55 55
             ('external_ids', external_ids))

+ 1
- 1
neutron/tests/common/l3_test_common.py View File

@@ -266,7 +266,7 @@ def router_append_subnet(router, count=1,
266 266
     if interface_id:
267 267
         try:
268 268
             interface = next(i for i in interfaces
269
-                         if i['id'] == interface_id)
269
+                             if i['id'] == interface_id)
270 270
         except StopIteration:
271 271
             raise ValueError("interface_id not found")
272 272
 

+ 16
- 13
neutron/tests/functional/agent/l3/framework.py View File

@@ -121,18 +121,19 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
121 121
             extra_routes = False
122 122
 
123 123
         return l3_test_common.prepare_router_data(ip_version=ip_version,
124
-                                                 enable_snat=enable_snat,
125
-                                                 num_internal_ports=(
126
-                                                     num_internal_ports),
127
-                                                 enable_floating_ip=enable_fip,
128
-                                                 enable_ha=enable_ha,
129
-                                                 extra_routes=extra_routes,
130
-                                                 dual_stack=dual_stack,
131
-                                                 v6_ext_gw_with_sub=(
132
-                                                     v6_ext_gw_with_sub),
133
-                                                 enable_pf_floating_ip=(
134
-                                                     enable_pf_floating_ip),
135
-                                                 qos_policy_id=qos_policy_id)
124
+                                                  enable_snat=enable_snat,
125
+                                                  num_internal_ports=(
126
+                                                      num_internal_ports),
127
+                                                  enable_floating_ip=(
128
+                                                      enable_fip),
129
+                                                  enable_ha=enable_ha,
130
+                                                  extra_routes=extra_routes,
131
+                                                  dual_stack=dual_stack,
132
+                                                  v6_ext_gw_with_sub=(
133
+                                                      v6_ext_gw_with_sub),
134
+                                                  enable_pf_floating_ip=(
135
+                                                      enable_pf_floating_ip),
136
+                                                  qos_policy_id=qos_policy_id)
136 137
 
137 138
     def _test_conntrack_disassociate_fip(self, ha):
138 139
         '''Test that conntrack immediately drops stateful connection
@@ -379,7 +380,9 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
379 380
                                           ipv6_subnet_modes=None,
380 381
                                           interface_id=None):
381 382
         return l3_test_common.router_append_subnet(router, count,
382
-                ip_version, ipv6_subnet_modes, interface_id)
383
+                                                   ip_version,
384
+                                                   ipv6_subnet_modes,
385
+                                                   interface_id)
383 386
 
384 387
     def _namespace_exists(self, namespace):
385 388
         return ip_lib.network_namespace_exists(namespace)

+ 1
- 1
neutron/tests/unit/agent/l3/test_agent.py View File

@@ -3271,7 +3271,7 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
3271 3271
         ifname = ri.get_internal_device_name(intf['id'])
3272 3272
         for subnet in intf['subnets']:
3273 3273
             return dibbler.PDDibbler(ri.router['id'],
3274
-                       subnet['id'], ifname).requestor_id
3274
+                                     subnet['id'], ifname).requestor_id
3275 3275
 
3276 3276
     def _pd_assert_dibbler_calls(self, expected, actual):
3277 3277
         '''Check the external process calls for dibbler are expected

+ 1
- 1
neutron/tests/unit/agent/l3/test_dvr_fip_ns.py View File

@@ -329,7 +329,7 @@ class TestDvrFipNs(base.BaseTestCase):
329 329
     @mock.patch.object(router_info.RouterInfo, 'get_router_cidrs')
330 330
     @mock.patch.object(ip_lib, 'IPDevice')
331 331
     def _test_scan_fip_ports(self, ri, ip_list, stale_list, IPDevice,
332
-        get_router_cidrs):
332
+                             get_router_cidrs):
333 333
         IPDevice.return_value = device = mock.Mock()
334 334
         device.exists.return_value = True
335 335
         ri.get_router_cidrs.return_value = ip_list

+ 0
- 0
neutron/tests/unit/agent/linux/test_keepalived.py View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save