18808 Commits

Author SHA1 Message Date
lingyongxu
c68e2a19aa Enable some off-by-default checks
Some of the available checks are disabled by default, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None

Change-Id: Ie38ec248651b57f2f2886cf90366cbf13673ffaf
2017-06-23 09:51:01 +08:00
Jenkins
7078a5d8ea Merge "DHCP Agent: Set dhcp-range netmask property" 2017-06-22 22:09:21 +00:00
Sławek Kapłoński
1df22cfb4e Add new ovo field type class
This patch adds new field type ListOfDictOfMiscValues which
can be used to represent list of dicts in OVO objects.

Change-Id: I809f9314f8ea9adce98758b600169a675a06c9ba
2017-06-22 21:27:07 +00:00
Viktor Varga
c4d65601ed Replaced assertTrue(False) with fail()
In some unit and functional tests self.assertTrue(False) was used
instead of self.fail(), which might be against readability.

Using assertTrue(False) gives the following message on fail:

  File "C:\Python361\lib\unittest\case.py", line 678, in assertTrue
    raise self.failureException(msg)
    AssertionError: False is not true

After replacing assertTrue(False) with fail():

  File "C:\Python361\lib\unittest\case.py", line 666, in fail
    raise self.failureException(msg)
    AssertionError: None

Although the results are the same (both tests failed), the
message 'False is not true' is unnecessary, and can be omitted
from the log by using fail().

Change-Id: I81e21040fd6a2f9713889912fafd2b19bd056b5a
2017-06-22 19:31:00 +02:00
Brian Haley
91b579c287 Fix tempest router creation
Tempest router migration tests need to create
routers explicitly - without HA and/or Distributed
values set, since they might be run in different
environments where those migrations are not
allowed.

Change-Id: Ib817c9390b506a935a46f57e93e8a083ddd304e6
2017-06-22 11:44:52 -04:00
Harald Jensas
c28dd28514 DHCP Agent: Set dhcp-range netmask property
To complete the DHCP support for non-local routed networks via relay
agent the dhcp agent must configure the netmask in the --dhcp-range
option for IPv4 networks. This was previously not required becuase
dnsmasq can determine it from the local interface information for
local networks.

DNSMASQ(8)
  For directly connected networks (ie, networks on which the machine
  running dnsmasq has an interface) the netmask is optional: dnsmasq
  will determine it from the interface configuration. For networks
  which receive DHCP service via a relay agent, dnsmasq cannot
  determine the netmask itself, so it should be specified, otherwise
  dnsmasq will have to guess, based on the class (A, B or C) of the
  network address. The broadcast address is always optional. It is
  always allowed to have more than one dhcp-range in a single subnet.

Change-Id: I5d609e47a3463c11338dd38aedebfb4a6822f503
Closes-Bug: #1699754
2017-06-22 16:28:20 +02:00
Jenkins
2ce4f19afd Merge "Ingress bandwidth limit rule in Linuxbridge agent" 2017-06-22 13:59:07 +00:00
Jakub Libosvar
4548ffd6b3 tempest-api: Skip test if deployment has not enough agents
Neutron deployments can have various number of agents. For agentless
deployments there is no point in running agent API tests so that should
be reflected in tempest.conf available extension.

One of the tests require at least two agents - this patch skips such
test if environment doesn't contain enough agents for running the test.

Change-Id: I0f006258aa89c1f52fac73669352d725b109696c
Closes-bug: #1699199
2017-06-22 12:15:12 +00:00
Jenkins
3b93fad8d6 Merge "Correct the config group in check_trunk_dependencies" 2017-06-22 09:37:20 +00:00
Jenkins
8114dec504 Merge "Add revises_on_change to Binding DB models" 2017-06-22 09:36:57 +00:00
Jenkins
a8fe290c63 Merge "Use objects instead of SQLA deep copies in PortContext" 2017-06-22 09:35:13 +00:00
Sławek Kapłoński
da646496e3 Ingress bandwidth limit rule in Linuxbridge agent
Add support for QoS ingress bandwidth limiting in
linuxbridge agent.
It uses traffic shaping done by tc with tbf qdisc.

DocImpact: Ingress bandwidth limit in QoS supported by
           Linuxbridge agent

Change-Id: Id495b302d31f5527db3e45b51517bc53153e7fc2
Partial-Bug: #1560961
2017-06-22 08:20:48 +00:00
Jenkins
16d16206c9 Merge "Using constants in local" 2017-06-22 07:11:43 +00:00
Jenkins
39fc8522bc Merge "Fix bug when checking duplicated subnets for router interface" 2017-06-22 07:08:29 +00:00
Jenkins
6077d778e9 Merge "dvr: Move normal/output br-int flows to table TRANSIENT" 2017-06-22 07:08:12 +00:00
Jenkins
4f8128c8bc Merge "security group: pass update value to precommit_update" 2017-06-22 06:42:31 +00:00
Jenkins
dd52e9fbb8 Merge "Revert "Change list of available qos rules"" 2017-06-22 00:21:04 +00:00
ZhaoBo
012de2ea08 Correct the config group in check_trunk_dependencies
The 'securitygroup' is registered as cfg.CONF.SECURITYGROUP. Currently,
this check always raise error as no 'cfg.CONF.securitygroup', then neutron
will abort the trunk_create. So nova will error when create VM with trunk
parent port for waiting timeout about the network-vif-plugged event.

Closes-Bug: #1699516
Related-Bug: #1669074
Change-Id: I0b0bdb5a39f1978e12ddaeddd4e0d825894ea241
2017-06-21 22:07:44 +00:00
Boden R
cbb0970b36 use attribute functions/operations from neutron-lib
neutron-lib now contains the functionality from neutron's attributes
module. This patch moves the local references over to neturon-lib's
implementation and removes the functionality from the attributes
module.

NeutronLibImpact

Change-Id: I773702ebd4b66d28059cb3ced64b2b477ceff8af
2017-06-21 10:58:28 -06:00
Brian Haley
bd9fc827c6 Fix some tempest deprecation warnings
Saw this recently in a tempest test run:

    DeprecationWarning: Read-only property 'manager'
    has moved to 'os_primary' in version 'Pike' and
    will be removed in version 'Queens'

Tempest BaseTestCase class credential names have changed
from manager->os_primary, admin->os_admin, and
alt_manager->os_alt, so we should start using them.

Closes-bug: #1697588
Change-Id: I44de8046fc983bf6780c310e8db174a5902c2826
2017-06-21 15:46:30 +00:00
Jakub Libosvar
b12e0f01fc functional: Replace unicode() with six.u()
unicode() is not present in Python 3

Change-Id: I1a6487d5c46884bf95704e3fd726e78c1dde9517
2017-06-21 13:53:31 +00:00
Victor Morales
6670954de3 Integration of IPAllocation
This patch integrates the Oslo-Versioned Object created for
IPAllocation model class.

Change-Id: Ibb731c4635d89c848081fac73f216d2ecf10b599
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
2017-06-21 17:33:41 +09:00
Isaku Yamahata
154b8750bc security group: pass update value to precommit_update
This patch is follow up for [1].
When updating security group, pass updated value to precommit.
old value is passed as original_security_group and new value
is passed as security_group.
[1] https://review.openstack.org/#/c/448420/

Although argument to callbacks will be unified by EventPayload
eventually, it's necessary to unbreak decomposed modules.

Change-Id: I5a27d1d218a0be4fae6f9740559bbbf773518821
Related-bug: #1546910
2017-06-20 22:21:23 -07:00
Jenkins
05c22d6199 Merge "Fix race between create subnet and port requests" 2017-06-21 03:36:31 +00:00
Jenkins
ccd7dadec5 Merge "Updated from global requirements" 2017-06-21 03:06:42 +00:00
Jenkins
5449e44587 Merge "DVR: Add forwarding routes based on address_scopes" 2017-06-21 03:06:15 +00:00
Dongcan Ye
3b461d4402 Using constants in local
In l3_db, we had already defined DEVICE_OWNER_ROUTER_GW from
neutron_lib, we can avoid import that module again.

TrivialFix

Change-Id: I7e7339e7f8d4201d3ca50cf24d08ee965ec099a0
2017-06-21 10:07:50 +08:00
Jenkins
9d9ae5af4a Merge "functional: Don't write strings to pipe" 2017-06-21 01:47:13 +00:00
Dongcan Ye
0415f4f50c Fix bug when checking duplicated subnets for router interface
If user set gateway for router first, and gateway subnet
overlapped with tenant subnet, will cause add router interface
to fail.

Add router interface checking for duplicated subnets should
ingore the gateway network.

This patch also filters gateway network when creating gw port.

Change-Id: Idcc8be221656ace13b12b62f559e4cb9a6af4f32
Closes-Bug: #1697410
2017-06-21 09:03:26 +08:00
Jenkins
f855f209a7 Merge "OVO: Allow port queries based on security_group_ids" 2017-06-21 00:38:38 +00:00
Jenkins
ff56e45406 Merge "Add missing info about supported ingress bandwidth limit rule" 2017-06-20 23:28:06 +00:00
Jenkins
adfcf111d1 Merge "TC doesn't rise exception if device doesn't exist" 2017-06-20 21:30:36 +00:00
Jenkins
1559763663 Merge "python3: use binary mode to open file in test" 2017-06-20 21:30:21 +00:00
Sławek Kapłoński
98f4362469 Add missing info about supported ingress bandwidth limit rule
Add missing information that Openvswitch agent supports now
both ingress and egress direction for QoS bandwidth limit rule.

Support for ingress bandwidth limit was added in
I9d94e27db5d574b61061689dc99f12f095625ca0

TrivialFix

Change-Id: I70058d1d8f16c58e41dab08fc66d5d3f5fcefa4b
2017-06-20 21:07:10 +00:00
Jakub Libosvar
330ebbb1b1 functional-tests: Make addresses for tunneling unique
OVS can hold only one tunnel with same endpoints. Some tests had
hardcoded values for both tunnel endpoints which made them unable to run
in parallel manner.

This patch takes always exclusive address using resource allocator.

Change-Id: If81296d54656551b24917d561f235edb96a6c2df
Closes-bug: #1697533
2017-06-20 20:17:35 +00:00
Manjeet Singh Bhatia
be8e9fc425 Add provider info to network for update
Ml2 Plugin is not sending provider info
while update_network to mechanism update_precommit,
due to which network becomes un-usable, This patch
extends the updated_network to include provider info.

Change-Id: I1838ce375b80f26ad37ede4bf438317f3bbd439f
Closes-Bug: #1698804
2017-06-20 19:52:10 +00:00
Jakub Libosvar
0c8dd7447a functional: Don't write strings to pipe
Python 3 doesn't support writing strings to descriptors. Write bytes
instead.

Change-Id: Ie732d00acc67c429d9f714bcfc116554fb523d36
2017-06-20 18:02:45 +00:00
Jenkins
c3e86bafdb Merge "Fix SG callbacks notification" 2017-06-20 17:56:31 +00:00
Bernard Cafarelli
033ab6cc17 python3: use binary mode to open file in test
With text mode, trying to write a binary string generates a TypeError in
python 3

Change-Id: I1b7d1a46d98814aacb4bf9a7f80b168c2b786e30
2017-06-20 17:20:56 +00:00
Jenkins
0962b6e76e Merge "use six.u rather than unicode for py3 compat" 2017-06-20 17:03:29 +00:00
Kevin Benton
3c1a25d968 Make HA deletion attempt on RouterNotFound race
The L3 HA RPC code that creates HA interfaces can race
with an HA router deletion on the server side. The L3 HA
code ends up creating a port on the HA network while the
server side is deleting the router and the HA network.

This stops the L3 HA network from being deleted because
it has a new port without a bound segment, which leaves the
HA network in a segmentless condition and no ports after
the L3 RPC code cleans up its port.

This adjusts the L3 RPC logic to attempt an HA network cleanup
whenever it encounters the concurrent router deletion case
to ensure that the HA network gets cleaned up.

To make this more robust in the future, we may need the L3
HA code to recognize when an HA network has no segments and
automatically create a new one.

Change-Id: Idd301f6df92e9bc37187e8ed8ec00004e67da928
Closes-Bug: #1696537
2017-06-20 12:18:09 -04:00
Jenkins
ef1e24e05d Merge "tempest: Make _create_router_with_client obey enable_snat=False" 2017-06-20 16:18:01 +00:00
Jenkins
9f3a4c9de2 Merge "Clean up test cases in test_iptables_firewall.py" 2017-06-20 14:52:41 +00:00
Jakub Libosvar
ce8a0b2b7d dvr: Move normal/output br-int flows to table TRANSIENT
DVR flows are not compatible with OVS firewall flows as firewall flows
have higher priority. As a consequence, rules for DVR were never match
as firewall uses output directly.

This patch replaces flows using normal or output actions and resends
packets to TRANSIENT table instead. This transient table then uses
either those normal or output action rules. With this split, we will be
able to match egress/ingress flows in TRANSIENT table instead of
LOCAL_SWITCHING putting DVR pipeline in front of OVS firewall pipeline.

Change-Id: I9f738047f131b42d11a90f539435006d16ea7883
Closes-bug: #1696983
2017-06-20 14:23:49 +00:00
lioplhp
5d9bc554a8 Fix html_last_updated_fmt for Python3.
html_last_updated_fmt option is interpreted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.

Change-Id: I82de8ad2a254843434e960f8b093ac8bba2ba89b
2017-06-20 21:45:31 +08:00
Jenkins
92f9c21d03 Merge "Fix linuxbridge ebtables locking" 2017-06-20 12:23:35 +00:00
OpenStack Proposal Bot
8856a761a2 Updated from global requirements
Change-Id: I218dbc85d829e96fb94cf840c910980c764ed454
2017-06-20 11:47:04 +00:00
Kevin Benton
43eb75fd1d Add revises_on_change to Binding DB models
All of the ML2 binding models were missing the revises_on_change
attribute to bump the revision of the port whenever they are
created/updated/deleted.

These are important because port binding happens in a separate
transaction so without them the revision number before and after
port binding was exactly the same. This opened up the L2 agent
to a race condition dependent on the order of processed push
notifications.

Closes-Bug: #1699034
Change-Id: I75f3c63941130ce845574e60214ac34e99111693
2017-06-20 01:34:17 -07:00
Kevin Benton
0f536d5a25 Use objects instead of SQLA deep copies in PortContext
The workaround of using deepcopy calls on the PortBinding
and PortBindingLevel objects prevents the port relationship
from being loaded to bump its revision because it then fails
to merge.

So in order to allow port bindings to bump the revision we
need to stop using sqlalchemy objects in the PortContext. This
patch adds a new snapshot object that just copies the column
values and provides a method to reconcile them back into the
session.

This workaround can go away after we switch to using OVOs, but
this needs to be backportable so we can't just wait for OVO
adoption.

Partial-Bug: #1699034
Change-Id: Ib85ec8182117fa3c4844dabfffe881e38e68b556
2017-06-20 01:34:10 -07:00
Kevin Benton
1db5ace55e OVO: Allow port queries based on security_group_ids
This is needed to retrieve all ports in a given set of
security groups.

Partially-Implements: blueprint push-notifications
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
Change-Id: Iffa1bd341d9d20277ec153aa1dac6f61f05ec5bd
2017-06-20 08:33:22 +00:00