MANY flake8 error fixes, all cosmetic
This commit is contained in:
@@ -17,7 +17,7 @@ from quark.db.custom_types import INET
|
||||
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
# commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
'quark_mac_address_ranges',
|
||||
sa.Column('id', sa.String(length=36), nullable=False),
|
||||
@@ -260,11 +260,11 @@ def upgrade():
|
||||
sa.ForeignKeyConstraint(['port_id'], ['quark_ports.id'], ),
|
||||
mysql_engine='InnoDB'
|
||||
)
|
||||
### end Alembic commands ###
|
||||
# end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
# commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('quark_port_ip_address_associations')
|
||||
op.drop_table('quark_dns_nameservers')
|
||||
op.drop_index('ix_quark_ip_addresses_version',
|
||||
@@ -299,4 +299,4 @@ def downgrade():
|
||||
op.drop_table('quark_ip_policy')
|
||||
op.drop_table('quark_tag_associations')
|
||||
op.drop_table('quark_mac_address_ranges')
|
||||
### end Alembic commands ###
|
||||
# end Alembic commands ###
|
||||
|
||||
@@ -14,7 +14,7 @@ from alembic import op
|
||||
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
# commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index(op.f('ix_quark_mac_addresses_deallocated'),
|
||||
'quark_mac_addresses',
|
||||
['deallocated'],
|
||||
@@ -22,12 +22,12 @@ def upgrade():
|
||||
op.create_unique_constraint('mac_address_range_id_address',
|
||||
'quark_mac_addresses',
|
||||
['mac_address_range_id', 'address'])
|
||||
### end Alembic commands ###
|
||||
# end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
# commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('mac_address_range_id_address', 'quark_mac_addresses')
|
||||
op.drop_index(op.f('ix_quark_mac_addresses_deallocated'),
|
||||
table_name='quark_mac_addresses')
|
||||
### end Alembic commands ###
|
||||
# end Alembic commands ###
|
||||
|
||||
@@ -14,15 +14,15 @@ from alembic import op
|
||||
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
# commands auto generated by Alembic - please adjust! ###
|
||||
op.create_unique_constraint(
|
||||
'subnet_id_address',
|
||||
'quark_ip_addresses',
|
||||
['subnet_id', 'address'])
|
||||
### end Alembic commands ###
|
||||
# end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
# commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint('subnet_id_address', 'quark_ip_addresses')
|
||||
### end Alembic commands ###
|
||||
# end Alembic commands ###
|
||||
|
||||
@@ -433,7 +433,7 @@ class NVPDriver(base.BaseDriver):
|
||||
if phys_net and not net_type:
|
||||
raise exceptions.ProvidernetParamError(
|
||||
msg="provider:network_type parameter required")
|
||||
if not net_type in ("bridge", "vlan") and segment_id:
|
||||
if net_type not in ("bridge", "vlan") and segment_id:
|
||||
raise exceptions.SegmentIdUnsupported(net_type=net_type)
|
||||
if net_type == "vlan" and not segment_id:
|
||||
raise exceptions.SegmentIdRequired(net_type=net_type)
|
||||
|
||||
@@ -4,7 +4,6 @@ import sys
|
||||
from gunicorn.app import base
|
||||
from gunicorn import config as gconfig
|
||||
from oslo.config import cfg
|
||||
|
||||
from neutron.common import config
|
||||
from neutron.common import legacy
|
||||
from neutron.common import utils
|
||||
|
||||
@@ -19,15 +19,12 @@ Quark Pluggable IPAM
|
||||
|
||||
import random
|
||||
import uuid
|
||||
|
||||
import netaddr
|
||||
from neutron.common import exceptions
|
||||
from neutron.openstack.common import log as logging
|
||||
from neutron.openstack.common.notifier import api as notifier_api
|
||||
from neutron.openstack.common import timeutils
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
from quark.db import api as db_api
|
||||
from quark.db import models
|
||||
from quark import exceptions as q_exc
|
||||
@@ -295,8 +292,7 @@ class QuarkIpam(object):
|
||||
|
||||
This should provide a performance boost over attempting to check
|
||||
each and every subnet in the existing reallocate logic, as we'd
|
||||
have to iterate over each and every subnet returned
|
||||
"""
|
||||
have to iterate over each and every subnet returned """
|
||||
if not (ip_address is None and "mac_address" in kwargs and
|
||||
kwargs["mac_address"]):
|
||||
return self._allocate_from_subnet(context, net_id, subnet,
|
||||
|
||||
@@ -17,13 +17,11 @@
|
||||
v2 Neutron Plug-in API Quark Implementation
|
||||
"""
|
||||
from oslo.config import cfg
|
||||
|
||||
from neutron.db import api as neutron_db_api
|
||||
from neutron.extensions import securitygroup as sg_ext
|
||||
from neutron import neutron_plugin_base_v2
|
||||
from neutron.openstack.common import log as logging
|
||||
from neutron import quota
|
||||
|
||||
from quark.api import extensions
|
||||
from quark.db import models
|
||||
from quark.plugin_modules import ip_addresses
|
||||
|
||||
@@ -14,12 +14,10 @@
|
||||
# under the License.
|
||||
|
||||
import webob
|
||||
|
||||
from neutron.common import exceptions
|
||||
from neutron.openstack.common import importutils
|
||||
from neutron.openstack.common import log as logging
|
||||
from oslo.config import cfg
|
||||
|
||||
from quark.db import api as db_api
|
||||
from quark import exceptions as quark_exceptions
|
||||
from quark import plugin_views as v
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
import netaddr
|
||||
from neutron.openstack.common import log as logging
|
||||
|
||||
from quark.db import api as db_api
|
||||
from quark import exceptions as quark_exceptions
|
||||
from quark import plugin_views as v
|
||||
|
||||
@@ -18,11 +18,9 @@ View Helpers for Quark Plugin
|
||||
"""
|
||||
|
||||
import netaddr
|
||||
|
||||
from neutron.extensions import securitygroup as sg_ext
|
||||
from neutron.openstack.common import log as logging
|
||||
from oslo.config import cfg
|
||||
|
||||
from quark.db import api as db_api
|
||||
from quark.db import models
|
||||
from quark import network_strategy
|
||||
@@ -122,11 +120,11 @@ def _make_subnet_dict(subnet, fields=None):
|
||||
for route in subnet["routes"]:
|
||||
netroute = netaddr.IPNetwork(route["cidr"])
|
||||
if _is_default_route(netroute):
|
||||
#NOTE(mdietz): This has the potential to find more than one default
|
||||
# route. Quark normally won't allow you to create
|
||||
# more than one, but it's plausible one exists
|
||||
# regardless. As such, we're going to pretend
|
||||
# it isn't possible, but log it anyway.
|
||||
# NOTE(mdietz): This has the potential to find more than one
|
||||
# default route. Quark normally won't allow you to create
|
||||
# more than one, but it's plausible one exists regardless.
|
||||
# As such, we're going to pretend it isn't possible, but
|
||||
# log it anyway.
|
||||
if default_found:
|
||||
LOG.info(_("Default route %(gateway_ip)s already found for "
|
||||
"subnet %(id)s") % res)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
import contextlib
|
||||
import cProfile as profiler
|
||||
import gc
|
||||
try:
|
||||
@@ -23,9 +24,6 @@ except Exception:
|
||||
pass
|
||||
import sys
|
||||
import time
|
||||
|
||||
import contextlib
|
||||
|
||||
from neutron.api.v2 import attributes
|
||||
from neutron.openstack.common import log as logging
|
||||
|
||||
|
||||
Reference in New Issue
Block a user