17703 Commits

Author SHA1 Message Date
Kevin Benton
42631e3117 Scan for mac through all devices
The first device the agent happens to pick could be something
without a mac address like a 6in6 interface. This was causing
the agent to fail to start if it was unlucky enough to pick
that address.

This patch just adjusts the logic to keep iterating through
the list until we find a mac.

Closes-Bug: #1669087
Change-Id: I6e934a2dff8fd441e1c70c9a5857fd6150835e2a
2017-03-01 11:19:16 -08:00
Jenkins
e2e90dd83f Merge "Updated from global requirements" 2017-03-01 16:58:45 +00:00
Jenkins
723160f5e6 Merge "Add some debug statements to root-cause 1666493" 2017-03-01 16:48:44 +00:00
Jenkins
da507c616d Merge "Use registry.receives decorator in neutron.db.l3_hamode_db" 2017-03-01 14:18:06 +00:00
Kevin Benton
1fae7ad108 LB Trunk: Stop matching MAC of subport to port model
Matching the MAC of the tap interface on the hypervisor
to the MAC that the VM will actually use to send traffic
through the tap causes the following error messages:

brq9e974900-cd: received packet on tapa8a6ce4a-e8 with
own address as source address

This is triggering a warning because there are now two
forwarding entries on the bridge, a static one from the
tap device, and a learned one from the packets received.[1]

Due to the presence of a static MAC entry, this will break
things like allowed_address_pair use cases that allow a MAC
to be used by multiple ports.

This patch removes all of the logic to set the MAC
address on the TAP device because it didn't serve any
other purpose than easy to correlate output from
ip link show commands and neutron port MAC addresses.

TAP devices will now just get whatever MAC address the kernel
selects for them.


1. https://lists.linuxfoundation.org/pipermail/bridge/2004-January/003740.html



Closes-Bug: #1668209
Change-Id: I0ff46f9550a79f486063a8e2810ed3b1140a4769
2017-03-01 14:10:00 +00:00
Kevin Benton
5dabde032f Switch external network create event to precommit
This addresses a TODO to convert the notification event to
PRECOMMIT_CREATE instead of BEFORE_CREATE and AFTER_CREATE since
both of these are occuring in a transaction which violates the AFTER
semantics.

Change-Id: Idba21275ade85a1a4afadee00de9ccbaec49b2f9
2017-03-01 13:02:45 +00:00
Jenkins
49b269adc6 Merge "Fix has_registry_receivers for classes w/o __new__" 2017-03-01 09:26:45 +00:00
OpenStack Proposal Bot
955347a54c Updated from global requirements
Change-Id: I15e7a6c8c90c4967cf318e169b61d91015b6ffef
2017-03-01 04:10:31 +00:00
Sean Dague
8626979c75 Convert gate_hook to devstack-tools
Devstack does not support multiple duplicate sections in local.conf.
Currently it works by chance, and is not guaranteed to work when next
changes land for devstack. So we should make sure we generate local.conf
that does not have duplicate sections.

This can be achieved using tools from devstack-tools package, that allow
to produce and merge multiple local.conf files compatible with devstack.

This change will need to be backport to all stable branches to
accommodate for branchless devstack-gate repo.

Related-Bug: #1667331
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Depends-On: I53119876b82eeaec19382dbe115cb1740bed0cec
Change-Id: Ibd0f67f9131e7f67f3a4a62cb6ad28bf80e11bbf
2017-02-28 22:08:01 +00:00
Jenkins
4ded53918f Merge "functional: Stop compiling OVS from source" 2017-02-28 19:32:26 +00:00
Cedric Brandily
576dfd2afd Remove unused enable_snat attribute
This change removes from RouterInfo the enable_snat attribute which is
never used in neutron nor neutron-*aas.

Change-Id: Icc2f9b306b7119c9d041d208d26e846ed3381507
2017-02-28 18:28:15 +01:00
Kevin Benton
b2e914b3d2 Fix has_registry_receivers for classes w/o __new__
When a class doesn't define __new__, the __new__ method is inherited
from the parent class using MRO; however, we capture the orig_new at
class definition time which doesn't have the definitive MRO because
we don't know how the class will be used. So calling orig_new when
it's inherited ends up skipping sibling class __new__ methods.

This fixes the has_registry_receivers decorator to detect the case
when a class doesn't have a custom __new__ method and performs
a super() call like a custom __new__ method would to ensure we
don't miss calling __new__ on any classes in the heirarchy.

Change-Id: I547a887dac113625a1045d95bab099059e99fc0c
2017-02-28 09:26:44 -08:00
Cedric Brandily
e1edf6f276 Use registry.receives decorator in neutron.db.availability_zone.router
Switch to registry.receives decorator in neutron.db.availability_zone.router

Partial-Bug: #1668262
Change-Id: Ib4e34159bf71a749eddf945fb942f679da7bacd0
2017-02-28 17:25:08 +01:00
Cedric Brandily
f448fd2229 Use registry.receives decorator in neutron.db.l3_hamode_db
Switch to registry.receives decorator in neutron.db.l3_hamode_db

Partial-Bug: #1668262
Change-Id: I57b9f268b2d26f9605452d57622d2c222625e2d2
2017-02-28 17:19:17 +01:00
Cedric Brandily
374de0ad49 Use registry.receives decorator in neutron.db.l3_dvr_db
Switch to registry.receives decorator in neutron.db.l3_dvr_db

Partial-Bug: #1668262
Change-Id: I01b0711e5a4f4729ce76519522271577516cacec
2017-02-28 17:12:55 +01:00
Jenkins
31efb40813 Merge "Use registry decorator in ML2 plugin" 2017-02-28 10:43:29 +00:00
Jenkins
a8c5bf0031 Merge "Prevent double-subscribes with registry decorator" 2017-02-28 10:34:29 +00:00
Jenkins
50d439b8a9 Merge "Use registry decorator in external_net_db" 2017-02-28 02:31:16 +00:00
Jenkins
a0d84499a3 Merge "Adding a code coverage threshold" 2017-02-27 23:02:40 +00:00
Armando Migliaccio
2273ad7b6b Fetch trunk port MTU only on trunk validation
During subport removal (when trunk validation is False) we do
not need to fetch the MTU.

TrivialFix

Change-Id: I9201e33fdc7da5a6aa45135d9531d65c92d83b12
2017-02-27 19:20:34 +00:00
Jenkins
edeb1f0bcc Merge "Mark of_interface option deprecated" 2017-02-27 13:53:17 +00:00
Kevin Benton
bb3931a992 Use registry decorator in ML2 plugin
Use the new registry decorator for subscribing to callbacks in ML2 so
its easy to see when each function will be called.

TrivialFix

Change-Id: I75e41b5801ff9dc7ea7edebfa7affa92fdcc9bd4
2017-02-27 05:17:06 -08:00
Kevin Benton
92116a0cc9 Prevent double-subscribes with registry decorator
This adds a simple flag to object instances to avoid multiple calls
to 'subscribe' for a class with multiple children that use the
'has_registry_receivers' decorator.

The registry manager protects from multiple subscriptions of the
same function by storing callbacks based on IDs, but this is necessary
to eliminate the duplicate debug logging statements.

Change-Id: I38e0a5f4c361435ae4af6c16a407191b1e722e37
2017-02-27 05:13:33 -08:00
Kevin Benton
3028edbf6b Use registry decorator in external_net_db
Switch to the registry decorator in external_net_db.

Change-Id: I764be99b2edbd0e7b54673c1940e883d7f313bf5
2017-02-27 04:24:57 -08:00
Jenkins
3b0a359cdb Merge "Fix string case issue in rpc_api documentation" 2017-02-27 12:12:16 +00:00
Jenkins
6c4c28746e Merge "Stop handling interface drivers that don't support MTU" 2017-02-27 12:12:07 +00:00
Jenkins
fb9ef52816 Merge "Avoid applying noop lambdas per object in db_api.get_objects" 2017-02-27 12:08:49 +00:00
Jenkins
363bae9eac Merge "Clean up deprecated sqla model import paths" 2017-02-27 12:02:37 +00:00
Jenkins
6f01617fc5 Merge "Switch to use idempotent_id decorator from tempest.lib" 2017-02-27 11:51:32 +00:00
Jenkins
8cbcd24bcd Merge "OpenFlowSwitchMixin: do not override delete_flows" 2017-02-27 11:11:08 +00:00
Jenkins
f09b45f0c3 Merge "Macvtap: Check for no original port in is_live_migration" 2017-02-27 10:43:50 +00:00
Jenkins
82256a96fc Merge "Registry decorator to bring subscribes to methods" 2017-02-26 18:14:28 +00:00
Jenkins
f8d562b9b1 Merge "Fix OVSBridge.delete_flows when called with no args" 2017-02-26 16:54:19 +00:00
Jenkins
3e34db0c19 Merge "Cleanup _find_related_obj" 2017-02-26 16:54:06 +00:00
Jenkins
3379999688 Merge "Allow no network to be passed into PortContext" 2017-02-25 19:17:56 +00:00
Sławek Kapłoński
04618af085 Switch to use idempotent_id decorator from tempest.lib
Decorator idempotent_id() in tempest.test is deprecated and
tempest.lib.decorators.idempotent_id() should be used instead.
This patch switch all tempest tests to use new decorator.

Change-Id: I2df9c13fbb44b8807da6805761ad30bfd010dc55
2017-02-25 14:24:15 +00:00
Jenkins
fe0b704177 Merge "Remove a NOTE that doesn't make sense anymore" 2017-02-25 13:25:47 +00:00
Jenkins
7807bb51ff Merge "Add bashate support" 2017-02-25 13:25:32 +00:00
Victor Morales
49bec33d45 Adding a code coverage threshold
The current implementation of the coverage code job gate only fails
when the report is not created. This change pretends to set a
minimum reasonable percentage of code coverage(82%).

Change-Id: Ia30116fff8b834486bde93c329543fce15be429f
2017-02-25 06:30:36 +00:00
Kevin Benton
ccccbb1ba0 Remove a NOTE that doesn't make sense anymore
5d53dfb8d64186b5b1d2f356fbff8f222e15d1b2 removed the function
call getting the tenant ID. Now it's always there so this note
and the assignment to a variable isn't needed.

TrivialFix

Change-Id: Ic036616202301082a30ba3e4f1ccc7fb459eb1fb
2017-02-25 06:30:14 +00:00
Victor Morales
a14439549f Add bashate support
Bashate is a style checker program for bash scripts.  This addition
improves the quality of the current bash scripts and ensures that
any future change will follow the same standards.

Change-Id: Ia346f77632d4ac7beb288fa3aacea221d7969c87
2017-02-25 06:29:55 +00:00
Kevin Benton
6dee4c5942 Cleanup _find_related_obj
All of the additional lookup logic was essentially duplicating
a relationship property of 'load_on_pending=True', which tells
SQLAlchemy to lookup the relationship during object creation [1].
So we can dump all of this logic and just use that option.

1. http://docs.sqlalchemy.org/en/latest/orm/relationship_api.html
   #sqlalchemy.orm.relationship.params.load_on_pending

Related: blueprint push-notifications
Change-Id: I0e495a50f5cab9b6449825039d7683d77de1e763
2017-02-25 06:29:33 +00:00
Shaohe Feng
fa04ab0fcf tiny refine: capitalize mod_name with string capitalize function
string capitalize can return a copy of the string S with only its first
character capitalized.

Change-Id: If76b63e0b6c1c9ab957afdf66d3e7c76367afb2c
2017-02-25 05:48:12 +00:00
IWAMOTO Toshihiro
367d354021 Mark of_interface option deprecated
Per Ocata Design Summit discussion, ovs-ofctl of_interface driver
will be deprecated and removed.

Change-Id: I0d94036e25919db1197819f5fe429205b01eee33
Related-blueprint: ovs-ofctl-to-python
2017-02-25 05:46:14 +00:00
Jakub Libosvar
7210696702 functional: Stop compiling OVS from source
There is a bug 1640283 fixed in OVS 2.5.1 but currently we ship Neutron
with openvswitch 2.5.0. The patch adds a decorator that skips particular
tests in case minimal version requirement is not met.

Change-Id: I3a665f3ba770e4acad7e7ead3f8cc557a86952cf
2017-02-25 04:35:30 +00:00
Ihar Hrachyshka
88e99f6f28 Clean up deprecated sqla model import paths
Those were moved under neutron.db.models start of Ocata. We should be
able to clean them up now.

NeutronLibImpact

Change-Id: Iadbf44d52ee8e30712807384152a29ce1a8b8f72
2017-02-25 03:42:34 +00:00
Ihar Hrachyshka
2708e19468 gate_hook: accept dsvm-scenario-[ovs|linuxbridge] venv name
Also enable ovs firewall for all jobs that match 'ovs' in $VENV. This
will be needed to switch dvr/ovs scenario job to the new firewall
driver, that should fix test_trunk.

Change-Id: I5a36fa3a44e9de4225a00c854a95ad7b5d8987f7
Needed-By: Ie3261f528ccedb5fc2b1597c84cf998e82ede2cd
2017-02-24 19:58:01 +00:00
Thomas Morin
2c54cc22ef OpenFlowSwitchMixin: do not override delete_flows
With this change the delete_flow variant implementation
of OpenFlowSwitchMixin, which was overriding the parent implementation
from ovs_lib in an incompatible way using the native ryu implementation,
is renamed into uninstall_flows.

As discussed in bug 1628455, the approach consisting in
extending the _keyword dict to convert ovs-ofctl rules into ryu
parameters does not seem practical.

This change also updates calls to delete_flows so that, when
enabled, the native interface will be used.  Similar calls outside neutron
repo need to be updated as well, which will be done in separate changes.

Change-Id: I90ff1055d367609694eef975c7d084e4cd7a2cf4
Closes-Bug: 1628455
Needed-By: Idd2315565cc9c88319984d83487148bf498e91ab
2017-02-24 10:43:31 -05:00
Thomas Morin
fcde09462d Fix OVSBridge.delete_flows when called with no args
With this change calling delete_flows with no kwargs will (instead
of resulting in calling "ovs-ofctl <action> <bridge> -", which does
nothing with no flow spec given on stdin) result in calling
"ovs-ofctl <action> <bridge>", which will delete all flows.

This aligns the behavior of delete_flows with the behavior currently seen by
all callers for the same method shadowed by the implementations in
OpenFlowSwitchMixin classes.

Change-Id: Ic0449acb3a0d4915ce025300d6f3c507a3cd8e48
Closes-Bug: 1658019
2017-02-24 10:43:30 -05:00
Ihar Hrachyshka
79452619bf Remove obsolete comment
This comment should have been cleaned up as part of
Id0517758d06e036a36dc8b8772e41af55d986b4e but we missed it during
review. Now the comment only makes readers wonder how it's relevant to
METADATA_SERVICE_NAME constant that it seems to describe, though it
doesn't.

TrivialFix

Change-Id: Ibdd811f21c6a921e309a172e26c713c964bdffa5
2017-02-24 01:14:01 +00:00