Fix handling of CIDR in allowed address pairs

A CIDR in allowed address pairs would screw up
the calculation of remote security group member
IP addresses due to a call that assumed each entry
was an IP. This patch fixes that an adds a remote
security group reference to the address pairs SG
test case to exercise this code-path.

Closes-Bug: #1382562
Change-Id: I2676f4b56bce7449579d67fb221b3edb7b885103
Fix PYTHONHASHSEED bugs in test_security_groups_rpc

This fixes the test_security_groups_rpc unit test that breaks with a
randomized PYTHONHASHSEED (see the bug report).

The test assumed that several Dicts had elements in a particular order.
Found with PYTHONHASHSEED=2701526934.

The fix refactors the test case by using an OrderedDict instead of a Dict.
Or in the case of the regex strings, injecting different values depending
on the order of the devices2 and devices3 Dicts.

An upstream spelling mistake is also addressed in this patch.

Partial-bug: #1348818

Note: There are several other unrelated unit tests that also break with a
randomized PYTHONHASHSEED, but they are not addressed here. They will be
addressed in separate patches.

Change-Id: I744117edfc5869b0750349a89f2792f622e4285d
Fix metadata proxy start problem for v6-v4 network

Commit 1b66e11b5d8c0b3de0610ca02c3e10b6f64ae375 introduces
a new problem that metadata proxy will not be started when
an isolated network contains ipv6 subnet with dhcp enabled
and a ipv4 subnet.

This fix separates the checks to enable dhcp and enable metadata
so metadata proxy can be started if there is ipv4 subnet exists
in the network with metadata enabled.

Change-Id: If26806083db225e9ab30d75fa6c728ce99a7cafe
Closes-Bug: 1392564
Drop RpcProxy usage from brocade plugin

This patch drops the usage of the RpcProxy compatibility class from
the brocade plugin.  The equivalent usage of oslo.messaging APIs is
now used instead.

Note that there is one very minor functional change included.  The
previous code set the base version to '1.1'.  It should be '1.0'.  The
proper pattern to use is to set the base version on the client side to
be the initial version of the API (X.0).  Then, any methods that
require a newer version need to specify it.

Part of blueprint drop-rpc-compat.

Change-Id: I6cc343c1e88d666dd90842e5da36787b6693fc98
Drop RpcProxy usage from cisco.cfg_agent

Drop usage of the RpcProxy compatibility class from cisco.cfg_agent.
The equivalent direct usage of oslo.messaging APIs is now used
instead.

Part of blueprint drop-rpc-compat.

Change-Id: I3ec71b3689adf7e96cdc2fdbf501c5cc37a9e0e4
Drop RpcProxy usage from cisco.l3

Drop usage of the RpcProxy compatibility class from cisco.l3.  This
was the last of RpcProxy usage in the cisco plugin.  The equivalent
APIs from oslo.messaging are now used instead.

Part of blueprint drop-rpc-compat.

Change-Id: I340b6969e32ec20cb4864021ec332eb9c5bdf19c
Drop RpcProxy usage from hyperv plugin

Drop the usage of the RpcProxy compatibility class from the hyperv
plugin.  The equivalent oslo.messaging APIs are now used instead.

Part of blueprint drop-rpc-compat.

Change-Id: Ic0ec43d2fe1929b7225d8e797495f7949f98184a
Drop RpcProxy usage from ibm plugin

Drop usage of the RpcProxy compatibility class from the ibm plugin.
Direct usage of oslo.messaging APIs is now done instead.

Part of blueprint drop-rpc-compat.

Change-Id: I3163d0a5e5f042c02e83995e84eb962e002f27cb
Drop RpcProxy usage from mlnx plugin

This patch drops usage of the RpcProxy compatibility class from the
mlnx plugin.  The equivalent oslo.messaging APIs are now used instead.

Note that one test case was dropped, but only because it did not
provide any actual additional test coverage.

Also note that the base rpc version is set to '1.0' instead of '1.1'
as it was in the original code.  Setting the base to X.0 is the right
pattern.  Methods that require a newer version should specify it in
their implementation.  According to the API history comment here, the
methods in this class were not the ones changed in '1.1', so they
don't specify '1.1' as a requirement.

Part of blueprint drop-rpc-compat.

Change-Id: Ia8174b3e3415aa1e8588d908117e79a604e63881
Drop RpcProxy usage from nec plugin

This patch removes the usage of the RpcProxy compatibility class from
the nec plugin.  The equivalent usage of oslo.messaging APIs is now
used instead.

Part of blueprint drop-rpc-compat.

Change-Id: I0b3ee1437ad4525f1354caaba686b6ab7442db2f
Drop sudo requirement from a unit test

I noticed while working on some other stuff that a unit test was
prompting me for my sudo password.  I narrowed it down to the
offending test case and fixed it by mocking out the execute util, as
is done in several other places in these tests.

Change-Id: I93c6cdb8a26d3be5df5386091dc70a240ab7c190
Closes-bug: #1396276
Merge "Fix metadata proxy start problem for v6-v4 network"
Merge "Drop sudo requirement from a unit test"
Merge "Drop RpcProxy usage from brocade plugin"
Merge "Drop RpcProxy usage from cisco.cfg_agent"
Merge "Drop RpcProxy usage from cisco.l3"
Merge "Drop RpcProxy usage from hyperv plugin"
Merge "Drop RpcProxy usage from ibm plugin"
Merge "Fix handling of CIDR in allowed address pairs"
Merge "Fix PYTHONHASHSEED bugs in test_security_groups_rpc"