translates empty remote_ip_prefix to valid cidr for nova

Quantum allows empty remote_ip_prefix to mean "any host"
but Nova uses a CIDR as part of each rule.

Fixes bug 1180828

Change-Id: I4983515ccd0cc621491d63e59d6ab6ac4dd74b6a
add xml api sample tests to os-tenant-network

Change-Id: Ib79defe49c82a175cb8605aa3a65ccd2c48d68f7
Fix msg version type sent to cells RPC API

Regression fix from 6b16c8731c44e4a6c80b803f3e8afdd88386d577, cannot
build instances through cells.

The RPC dispatcher dislikes floats for version numbers.

bug 1190371

Change-Id: I18994ce8a524f88910cfe37c9b302296ce30102f
Fix _drop_unique_constraint_in_sqlite() function.

We got incorrect unique constrains in function
_drop_unique_constraint_in_sqlite().
New function `_get_unique_constraints_in_sqlite()` was added to fix it.

Change-Id: Iebb4c0e6c3e6a069ba5cde2fdb2a2ff1200b826f
Fixes: bug 1184526
Removed session from reservation_create()

Removed session objects from public reservation_create() function
in nova/db/sqlalchemy/api module. Minor code refactoring.

blueprint db-session-cleanup

Change-Id: Ib87dd407328b0208a92a7e50bf4117e85fc512fb
Fix nova-compute fails to start if quantum is down

When nova-compute starts it needs to check the state of instances that
were previously running and needs to query quantum. Previously, if
it queried quantum and quantum raised an error or was unreachable
nova-compute would terminate. This patch adds a retry loop to prevent
this from happening.

Fixes bug 1186357

Change-Id: I0d865e464f7bf60a0b6dc4ca8a42436d16e29790
Add notes about how doc generation works.

Change-Id: I562c743798aeae5e49bd2f96944c3cacd776a53d
Add yolanda to the mailmap.

Noticed a duplicate entry in the AUTHORS file, added to .mailmap.

Change-Id: I649df9d7273347bec72076dc16a5c2217d1bf1c1
Fix VMwareVCdriver reporting incorrect stats

fix bug #1180779

VMware nova compute drivers VMwareESXDriver and VMwareVCDriver
currently report stats for the column local_gb in MB instead of in GB
The fix would be to modify vmwareapi/host.py to ensure the values
reported for disk space are calculated in GB instead of MB.
Fix is done by further dividing the existing MB value by 1024 to
convert to GB.
The unit tests to check for capacity and freespace have been modified
to check for GB.

Change-Id: I0610047ee2bddefe0ccb46568c0f48de4c0941af
Silence exceptions from qpid connection.close() (from oslo)

This is commit 15d8d698b7 in oslo-incubator.

Fixes bug 1185465

Don't log exceptions that happen during connection.close().  They're
not surprising (a closed socket can't be read or written), don't
require sysadmin attention, and provide red herrings in the logs
to distract from finding real root causes of problems.

Change-Id: Ia0e25fbc11094b5ad5d6d2cf7d0e786acb3df1f6
hardcode pbr and d2to1 versions

Hard code pbr to d2to1 to >=0.2.10,<0.3 and
pbr to >=0.5,<0.6 for consistency across projects.

Change-Id: I7163bef37934856e5f80df336044f8ebcb690797
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Refactor libvirt driver exception handling

Centralize exception handling for id based instance lookups in new
method _lookup_by_id().

Change-Id: If8d215b85fabf235afcf78a9203378fbb26e68db
Fix quota checks while resizing up by admin

Fixes LP 1184594

Fixing a bug when admin issues a resize up for a user, it checks for
admin's quota instead of user's quota.

Change-Id: Ida5db9039396df0a08c699711b72882e2ef136f8
Fix a race where a soft deleted instance might be removed by mistake

When a soft deleted instance is restored there is a tiny risk that it
might be deleted if the reclaim periodic task runs at the same time.
This happens because the restore operation sets deleted_at to None
which makes the reclaim job think it is ok to delete the instance.

This can be resolved by restricting reclaims to only those instances
whose task_state is None.

Resolves bug 1186243.

Change-Id: Ia138e2d504b7482c46900583f019a32c70513245
Don't snat all traffic when force_snat_range set

When using /proc/sys/net/bridge/bridge-nf-call-iptables=1, bridged
traffic gets snatted even though it is being bridged out to an
external gateway. This can lead to asymmetric routes where traffic
goes out the fixed network and comes back on the float network
and can lead to packets being blocked by firewalls. Work around
this problem by only fallback snatting when the traffic is
going to one of the force_snat_ranges. If force_snat_range is not
set it defaults to the existing behavior of snatting all traffic
that doesn't hit an earlier rule.

Fixes bug 1182143

Change-Id: If496dad2308a68a6a4a9fd43d695943bc5034ac4
Enhance unit test code coverage for availability zone

In current unit test code for availability zone, the update and
delete operation for AZ is missing. So this review submits two
test methods to test AZ update and delete.

Change-Id: Id98756351f0ecdf5405b9dfea2602a9aee0c5522
Add missing exception to cell_update()

Add missing CellNotFound exception to
cell_update() in db.sqlalchemy.api,
which expected from this method.

Change-Id: I25699a08b581922b13ae62708486bdee6f8b0ac6
Skip ipv6 tests on system without ipv6 support

On system without ipv6 support, CONFIG_IPV6 disabled kernel for
instance, WSGI service testcases for ipv6 would fail for "[Errno 97]
Address family not supported by protocol".

Since there is no easy way to detect actual ipv6 support,
socket.has_ipv6 not working for this case, simply skip ipv6 tests if
errno.EAFNOSUPPORT happens.

Fixes: bug 1174404

Change-Id: I9fa8653f5ccfbcb8c31c51bfda137cb58388afde
Fixes test_config_drive unittest

Fixes test_detail_servers in the config drive unittest where the wrong db
stub was set which resulted in an empty server list being returned.
Fixes asserTrue typo which was never executed because of the empty server
list bug

Change-Id: I160e91c55e60e3636804b4d2b31800386a21538d
Sending volume IO usage broken

This is my fault, I didn't test the sending of notifications
enough when fixing bug 1182102, when the volume IO usage notifications
were been sent too often. This was merged as part of
https://review.openstack.org/#/c/29915

The issue was that the code worked for the first IO usage event (the
one I looked at). Then when constructing the event payload for the second
and following IO usage events the code path ended up comparing a datetime
object from the db with a cached string representation of the last_refreshed
date that was passed into the conductor via the RPC.

Since last_refreshed argument to vol_usage_update in the db layer is
not needed and is causing these issues. I have removed last_refreshed
argument from the db layer and deprecated it from the conduction API.

Change-Id: I2030eb7912c56134ea688a6e8bbfcdeddca28307