Create DHCP port for IPv6 subnet

There is a bug in dhcp agent code that when first port is created
in an IPv6 subnet, DHCP port is not automatically created.

This fix resolves this problem by removing the IP version check
in configure_dhcp_for_network method.

Change-Id: If3f405d367a7099d9f33d72d11ffcb7a393abe23
Closes-Bug: #1367500
l2population_rpc: docstring improvements

Closes-Bug: #1382319
Change-Id: I72284fbcb16ea2d94898adf357f226775a20d02a
tox.ini: Avoid using bash where unnecessary

Switch to sh, which is hopefully more ubiquitously available than bash.

A recent change (commit 085a35d657cf0fa41a402f2af66c4beaa0f60db2)
introduced bash dependency for "tox -e pep8".  It broke my environment,
where bash is not available.  This change aims to restore it.
As far as I undestand, the change in question doesn't actually need
the specific shell dialect.  So switch to sh, which is expected to be
available for any POSIX-like systems, would improve the situation.

Closes-Bug: #1382327
Change-Id: Ie023d2265d9949a3e3721f03e865e4acfb460de2
Hyper-V: Remove useless use of "else" clause on for loop

"else" on for loops is only important if the loop contains a "break"
statement.  Without a "break", the else block is _always_ executed and
it is clearer just to omit "else".

This change also enables the corresponding pylint warning, now that the
only offending case has been fixed.

Change-Id: Ibe8761cb40a7d2d564aa718d62c9f383b5ad711e
Only resync DHCP for a particular network when their is a failure

The previous implementation will loop through and restart the dhcp
process for all active networks any time there is an exception calling
a dhcp driver function. This allows a tenant who can create an exception
to cause every dhcp process to restart. On systems with lots of networks
this can easily take longer than the default resync timeout leading to a
system that becomes unresponsive because of the load continually restarting
causes.

This patch restarts only dhcp processes related to the network on which
operations are failing. It should be noted that if there was some kind
of missed notification for a subnet update, the previous implementation
may have incidentally fixed it by restarting everything on the off
chance that something else caused an exception, but obviously relying
on that would be a bad idea as exceptions should be, well, exceptional.

Closes-bug: #1384402

Change-Id: I0b348a1657a7eb3a595f9bf6b217716a37ce38c6
NSX: allow multiple networks with same vlan on different phy_net

Previously, the NSX plugin prevented one from creating multiple networks on
the same vlan even if they were being created on different physical_networks.
This patch corrects this issue and allows this to now occur.

Closes-bug: 1367034

Change-Id: I343449648304328dffdd5ba070491e05686ee22d
Add advsvc role to neutron policy file

Add in a default "advsvc" user and the logic in the Neutron policy
infrastructure which will allow this user to create/get/update/delete
ports on other tenants networks, as well as view other tenants
networks. This is for the use case of letting advanced services have
a user to put ports on other tenants networks. By default, we do not
define any roles for the policy "context_is_advsvc", but rely on
operators to specify the likely value of "role advsvc".

DocImpact

Closes-Bug: #1331836

Change-Id: I94cb3383eb1fed793934719603f888dbbdbbd85a
Co-Authored-By: Susanne Balle <sleipnir012@gmail.com>
Use RPC instead of neutron client in metadata agent

RPC is a standard way of interacting between Neutron server and agents
Using neutron client is also  inefficient as it results in unneeded
keystone load and may become a bottleneck at scale

DocImpact
When upgrading, one should upgrade neutron server first,
then metadata agent. However there is a fallback in case
metadata agent fails to get info from server by rpc -
it will return to using neutron client.

Closes-Bug: #1092043

Change-Id: Ib75568643e6062543c0ff8cf80fba1b40b4fe82f
Reorder operations in (l3_dvr) update floating ip

This review overrides update_floatingip (L3_NAT_dbonly_mixin)
in l3_dvr_db (L3_NAT_with_dvr_db_mixin) to reorder the garbage
collection to after the floating ip is updated and rpc called.
This was previously being called in the (already) overridden
_update_fip_assoc.

Since this call is moved, the _update_fip_assoc for l3_dvr_db
is exactly the same as l3_db and is thus removed completely.

This tidy up was created whilst looking at bug 1381617. The
intention was to mitigate the timing issues exposed by [1]
and discussed in the bug report. It seems the problem persists
with more discussion around 'properly fixing' this at [2].

[1] https://review.openstack.org/#/c/102700/
[2] https://review.openstack.org/#/c/130414/4

Change-Id: I24cef57bf394ceeb931ff48fa67f18218c734b00
Merge "Add advsvc role to neutron policy file"
Merge "NSX: allow multiple networks with same vlan on different phy_net"
Merge "Hyper-V: Remove useless use of "else" clause on for loop"
Merge "Use RPC instead of neutron client in metadata agent"
Imported Translations from Transifex

For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I25a1b72a78a94e00b28e5d128b5be591fe565b3c
Rename constant to a more appropriate name

The DB_MAX_RETRIES implies that a query will be
retried that many times. 'retry' means it happened
once before. In the current code, if DB_MAX_RETRIES
is set to 1, the query won't be retried at all.
If it's set to 0, the query won't even be run.

This constant should actually be called DB_MAX_ATTEMPTS
to indicate that the variable includes the first try.

Change-Id: I13f088ffa38c40db7fd297173e892b4ad5c7fadd
Merge "l2population_rpc: docstring improvements"
Detect if iproute2 support SR-IOV commands

Add sanity_check that 'ip link' command supports VF management and
link state changes of VF by parsing 'ip link help' command output.

Co-authored-by: Samer Deeb <samerd@mellanox.com>
Closes bug: 1349302

Change-Id: I5a72a9061a76c39960076f078905371f07069431
Merge "Only resync DHCP for a particular network when their is a failure"
Merge "Rename constant to a more appropriate name"
Merge "Imported Translations from Transifex"