Merge "Cleanup and enforce pep8 checks"

This commit is contained in:
Jenkins 2017-06-11 06:54:46 +00:00 committed by Gerrit Code Review
commit 3c7afdc733
6 changed files with 95 additions and 102 deletions

View File

@ -64,7 +64,7 @@ class BridgeDriver(BaseBridgeDriver):
class VIFOpenVSwitchDriver(BaseBridgeDriver):
def connect(self, vif, ifname, netns):
super(VIFOpenVSwitchDriver, self).connect(vif, ifname, netns)
#FIXME(irenab) use pod_id (neutron port device_id)
# FIXME(irenab) use pod_id (neutron port device_id)
instance_id = 'kuryr'
net_utils.create_ovs_vif_port(vif.bridge_name, vif.vif_name,
vif.port_profile.interface_id,

View File

@ -69,9 +69,9 @@ class DriverBase(object):
if not isinstance(driver, cls):
raise TypeError(_("Invalid %(alias)r driver type: %(driver)s, "
"must be a subclass of %(type)s") % {
'alias': alias,
'driver': driver.__class__.__name__,
'type': cls})
'alias': alias,
'driver': driver.__class__.__name__,
'type': cls})
return driver

View File

@ -36,15 +36,15 @@ class LinuxNetworkUtilsTestCase(test_base.TestCase):
def test_create_ovs_vif_port(self):
calls = [
mock.call('ovs-vsctl', '--', '--if-exists',
'del-port', 'fake-dev', '--', 'add-port',
'fake-bridge', 'fake-dev',
'--', 'set', 'Interface', 'fake-dev',
'external-ids:iface-id=fake-iface-id',
'external-ids:iface-status=active',
'external-ids:attached-mac=fake-mac',
'external-ids:vm-uuid=fake-instance-uuid',
run_as_root=True)]
mock.call('ovs-vsctl', '--', '--if-exists',
'del-port', 'fake-dev', '--', 'add-port',
'fake-bridge', 'fake-dev',
'--', 'set', 'Interface', 'fake-dev',
'external-ids:iface-id=fake-iface-id',
'external-ids:iface-status=active',
'external-ids:attached-mac=fake-mac',
'external-ids:vm-uuid=fake-instance-uuid',
run_as_root=True)]
with mock.patch.object(utils, 'execute', return_value=('', '')) as ex:
linux_net.create_ovs_vif_port('fake-bridge', 'fake-dev',
'fake-iface-id', 'fake-mac',
@ -53,9 +53,9 @@ class LinuxNetworkUtilsTestCase(test_base.TestCase):
def test_delete_ovs_vif_port(self):
calls = [
mock.call('ovs-vsctl', '--', '--if-exists',
'del-port', 'fake-bridge', 'fake-dev',
run_as_root=True)]
mock.call('ovs-vsctl', '--', '--if-exists',
'del-port', 'fake-bridge', 'fake-dev',
run_as_root=True)]
with mock.patch.object(utils, 'execute', return_value=('', '')) as ex:
linux_net.delete_ovs_vif_port('fake-bridge', 'fake-dev')
ex.assert_has_calls(calls)

View File

@ -77,9 +77,9 @@ class TestNoOpPlugin(base.TestCase):
expected = objects.host_info.HostPluginInfo(
plugin_name='noop',
vif_info=[
objects.host_info.HostVIFInfo(
vif_object_name=k_vif.VIFVlanNested.__name__,
min_version="1.0",
max_version="1.0"),
objects.host_info.HostVIFInfo(
vif_object_name=k_vif.VIFVlanNested.__name__,
min_version="1.0",
max_version="1.0"),
])
self.assertEqual(expected, result)

View File

@ -49,15 +49,8 @@ commands =
commands = python setup.py build_sphinx
[flake8]
# E125 continuation line does not distinguish itself from next logical line
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
# E129 visually indented line with same indent as next logical line
# E265 block comment should start with '# '
# TODO(dougwig) -- uncomment this to test for remaining linkages
# N530 direct neutron imports not allowed
# N531 log message does not translate
ignore = E125,E126,E128,E129,E265,H301,N530,N531
ignore = E128
show-source = true
# TODO(dougw) neutron/tests/unit/vmware exclusion is a temporary services split hack