And yet moar flake8 fixes
This commit is contained in:
@@ -406,8 +406,10 @@ class NVPDriver(base.BaseDriver):
|
||||
return results
|
||||
|
||||
def _lswitch_select_open(self, context, switches=None, **kwargs):
|
||||
"""Selects an open lswitch for a network. Note that it does not select
|
||||
the most full switch, but merely one with ports available.
|
||||
"""Selects an open lswitch for a network.
|
||||
|
||||
Note that it does not select the most full switch, but merely one with
|
||||
ports available.
|
||||
"""
|
||||
|
||||
if switches is not None:
|
||||
|
@@ -23,8 +23,8 @@ import uuid
|
||||
import netaddr
|
||||
from neutron.common import exceptions
|
||||
from neutron.openstack.common import log as logging
|
||||
from neutron.openstack.common import timeutils
|
||||
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
|
||||
@@ -286,6 +286,7 @@ class QuarkIpam(object):
|
||||
def _allocate_from_v6_subnet(self, context, net_id, subnet,
|
||||
port_id, ip_address=None, **kwargs):
|
||||
"""This attempts to allocate v6 addresses as per RFC2462 and RFC3041.
|
||||
|
||||
To accomodate this, we effectively treat all v6 assignment as a
|
||||
first time allocation utilizing the MAC address of the VIF. Because
|
||||
we recycle MACs, we will eventually attempt to recreate a previously
|
||||
|
@@ -18,8 +18,8 @@ from neutron.common import config as neutron_cfg
|
||||
from neutron.common import exceptions
|
||||
from neutron.openstack.common import importutils
|
||||
from neutron.openstack.common import log as logging
|
||||
from neutron.openstack.common import timeutils
|
||||
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
|
||||
|
@@ -19,8 +19,7 @@ from neutron.db import quota_db
|
||||
|
||||
|
||||
class QuarkQuotaDriver(quota_db.DbQuotaDriver):
|
||||
"""Driver to perform necessary checks to enforce quotas and obtain quota
|
||||
information.
|
||||
"""Driver to perform necessary checks to enforce and obtain quotas.
|
||||
|
||||
The default driver utilizes the local database.
|
||||
"""
|
||||
|
@@ -160,7 +160,9 @@ class QuarkIPAddressFindReallocatable(QuarkIpamBaseFunctionalTest):
|
||||
yield net_mod
|
||||
|
||||
def test_find_reallocatable_ips_does_not_raise(self):
|
||||
"""A patch recently introduced a bug wherein addressses
|
||||
"""Regression testing
|
||||
|
||||
A patch recently introduced a bug wherein addressses
|
||||
could not be returned to the ip_address_find call in
|
||||
attempt_to_reallocate_ip. Adding this test to prevent
|
||||
a future regression.
|
||||
|
@@ -624,7 +624,9 @@ class TestQuarkCreateSubnet(test_quark_plugin.TestQuarkPlugin):
|
||||
self.plugin.create_subnet(self.context, subnet_request)
|
||||
|
||||
def test_create_subnet_default_route_gateway_ip(self):
|
||||
"""If default route (host_routes) and gateway_ip are both provided,
|
||||
"""Host_routes precedence
|
||||
|
||||
If default route (host_routes) and gateway_ip are both provided,
|
||||
then host_route takes precedence.
|
||||
"""
|
||||
|
||||
@@ -661,9 +663,7 @@ class TestQuarkCreateSubnet(test_quark_plugin.TestQuarkPlugin):
|
||||
self.assertEqual(res[key], subnet["subnet"][key])
|
||||
|
||||
def test_create_subnet_null_gateway_no_routes(self):
|
||||
"""Creating a subnet with a NULL gateway IP shouldn't
|
||||
create routes.
|
||||
"""
|
||||
"""A subnet with a NULL gateway IP shouldn't create routes."""
|
||||
|
||||
routes = [dict(cidr="0.0.0.0/0", gateway="172.16.0.4")]
|
||||
subnet = dict(
|
||||
|
@@ -14,7 +14,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
import unittest2
|
||||
|
||||
from neutron import context
|
||||
|
||||
|
||||
|
@@ -23,8 +23,8 @@ from neutron.openstack.common.notifier import api as notifier_api
|
||||
from oslo.config import cfg
|
||||
|
||||
from quark.db import models
|
||||
import quark.ipam
|
||||
from quark import exceptions as q_exc
|
||||
import quark.ipam
|
||||
from quark.tests import test_base
|
||||
|
||||
|
||||
|
@@ -145,9 +145,7 @@ class TestNVPDriverCreateNetwork(TestNVPDriver):
|
||||
|
||||
|
||||
class TestNVPDriverProviderNetwork(TestNVPDriver):
|
||||
"""Testing all of the network types is unnecessary, but it's nice for peace
|
||||
of mind.
|
||||
"""
|
||||
"""Testing all of the network types is unnecessary, but a nice have"""
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _stubs(self, tz):
|
||||
@@ -211,7 +209,9 @@ class TestNVPDriverProviderNetwork(TestNVPDriver):
|
||||
zone_uuid="net_uuid", transport_type="local", vlan_id=None)
|
||||
|
||||
def test_config_provider_attrs_bridge_net(self):
|
||||
"""Exists because internal driver calls can also call this method,
|
||||
"""A specialized case for NVP
|
||||
|
||||
This exists because internal driver calls can also call this method,
|
||||
and they may pass bridge in as the type as that's how it's known
|
||||
to NVP.
|
||||
"""
|
||||
|
@@ -97,8 +97,10 @@ class TestOptimizedNVPDriverDeleteNetwork(TestOptimizedNVPDriver):
|
||||
|
||||
|
||||
class TestOptimizedNVPDriverDeletePortMultiSwitch(TestOptimizedNVPDriver):
|
||||
'''Need to test if ports on switch = 0 delete switch if it is not the last
|
||||
switch on the network.
|
||||
'''Test for 0 ports on the switch, and the switch not last in network.
|
||||
|
||||
Need to test if ports on switch = 0 and delete the switch if it is not
|
||||
the last switch on the network.
|
||||
'''
|
||||
|
||||
@contextlib.contextmanager
|
||||
@@ -137,9 +139,7 @@ class TestOptimizedNVPDriverDeletePortMultiSwitch(TestOptimizedNVPDriver):
|
||||
|
||||
|
||||
class TestOptimizedNVPDriverDeletePortSingleSwitch(TestOptimizedNVPDriver):
|
||||
'''Need to test if ports on switch = 0 delete switch unless it is the last
|
||||
switch on the network.
|
||||
'''
|
||||
'''If ports on switch = 0, delete switch unless last on the network'''
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _stubs(self, port_count=2):
|
||||
@@ -170,6 +170,7 @@ class TestOptimizedNVPDriverDeletePortSingleSwitch(TestOptimizedNVPDriver):
|
||||
|
||||
class TestOptimizedNVPDriverCreatePort(TestOptimizedNVPDriver):
|
||||
'''In no case should the optimized driver query for an lswitch.'''
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _stubs(self, has_lswitch=True, maxed_ports=False):
|
||||
with contextlib.nested(
|
||||
@@ -433,9 +434,10 @@ class TestGetNetworkDetails(TestOptimizedNVPDriver):
|
||||
|
||||
|
||||
class TestQueryMethods(TestOptimizedNVPDriver):
|
||||
"""These tests provide coverage on the query helpers. No serious
|
||||
assertions are made, as there's no sense in testing that sqlalchemy
|
||||
does in fact do what it's supposed to do.
|
||||
"""These tests provide coverage on the query helpers.
|
||||
|
||||
No serious assertions are made, as there's no sense in testing that
|
||||
sqlalchemy does in fact do what it's supposed to do.
|
||||
"""
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
@@ -15,10 +15,10 @@
|
||||
|
||||
|
||||
import contextlib
|
||||
import time
|
||||
import sys
|
||||
|
||||
import cProfile as profiler
|
||||
import sys
|
||||
import time
|
||||
|
||||
import gc
|
||||
try:
|
||||
import pstats
|
||||
|
Reference in New Issue
Block a user