Add tests for nova.db.api.security_group_rule_* methods.

blueprint db-api-tests

Change-Id: I20b63683da78bcb99e1f88cc10ca71a64f1f17a9
Session cleanup for db.security_group_rule_* methods

Session objects shouldn't be used in public db.api methods
because db.api should be independent of db implementation.

Remove session parameter from:
test_security_group_rule_destroy
test_security_group_rule_get
test_security_group_rule_get_by_security_group
test_security_group_rule_get_by_security_group_grantee

blueprint db-session-cleanupRoutine refactor.

Change-Id: I36a71547124b655ed89d340fed02315f3b7f1530
Add missing tests for provider_fw_rule_* methods

There was no tests in test_db_api for provider_fw_rule_*
methods.

Add tests to ensure that all works.

blueprint db-api-tests

Change-Id: Ia137ffcfcba3f663a177386775147a25d6716980
Refactored tests for instance_actions_*

Moved tests to separate test case

blueprint db-api-tests

Change-Id: Ia4fdfdd3da58dcf6a04f96de7df7672bfc1200c5
Improved tests for instance_actions_*

Improved test assertions
Added tests to cover exceptions in db.api

blueprint db-api-tests

Change-Id: Iae1033ae6e67f62f9353b4660468ea766af38035
Adding fixed_ip in create.end notification

Sending the network information for an instance in the create.end notification.

Fixes bug 1185076

Change-Id: Iabe088ed23736d7b1ee97624761445023aab22c2
Drop `bm_pxe_ips` table from baremetal database.

- added migration and tests
- removed model `BareMetalPxeIp`
- from nova/virt/baremetal/db/sqlalchemy/api.py removed functions
 `bm_pxe_ip_get_all`, `bm_pxe_ip_create`, `bm_pxe_ip_create_direct`,
 `bm_pxe_ip_destroy`, `bm_pxe_ip_destroy_by_address`, 'bm_pxe_ip_get`,
 `bm_pxe_ip_get_by_bm_node_id`, `bm_pxe_ip_associate`, 'bm_pxe_ip_disassociate`
- from nova/virt/baremetal/db/api.py removed functions
 `bm_node_associate_and_update`, `bm_pxe_ip_create`, `bm_pxe_ip_create_direct`,
 `bm_pxe_ip_destroy`, `bm_pxe_ip_destroy_by_address`, `bm_pxe_ip_get_all`,
 `bm_pxe_ip_get`, `bm_pxe_ip_get_by_bm_node_id, `bm_pxe_ip_associate`,
 `bm_pxe_ip_disassociate`
- from nova/tests/virt/baremetal/db/utils.py removed function `new_bm_pxe_ip`
- removed nova/tests/virt/baremetal/db/test_bm_pxe_ip.py
- modified `baremetal/volume_driver.py` - now we get `address` using
  nova db api

Fixes bug 1156745

Change-Id: I61f78d692da276694d79a7c1a8d45a466d124c70
xenapi: ensure agent check respects image flags

The tests assumed sys_meta was in a simpler format
when accessed on the compute node. This change fixes
the code to work with the actual format of sys_meta.

Fixes bug 1190198
Change-Id: I31095e25bc86c8a475a58a7325e1ff2b3ae8e15c
Add rpc client side version control.

This is a first pass at client side version control for rpc.  It allows
you to configure a max version of messages that clients are allowed to
send.  You can find one example of how clients need to adapt in the
conductor rpcapi.  All other changes in rpc apis since the grizzly
release are not applicable to this.

Some future improvements to this could be reporting the versions
supported by running services and having that be discoverable via the
API.  We could also consider allow setting these client side version
caps via the API.  For now, recommended values for these config
options while attempting a rolling upgrade will just have to be documented.

The config options allow specifying specific rpc api version numbers if
desired, but an alias of 'grizzly' is also supported.  So typically at
the start of a rolling upgrade you'd have:

    [upgrade_levels]
    compute=grizzly
    conductor=grizzly
    scheduler=grizzly
    ... etc ...

And as you update all instances of a service, you would remove that bit
from your configuration across the deployment using your config management
system of choice.

DocImpact

Implements blueprint rpc-version-control.

Change-Id: I2c0fd6dd7484c87823846d7c31d6525d93cd1b43
Merge "Enhance the validation of the quotas update"
Merge "Refactored tests for instance_actions_*"
Merge "Fix VMware Hyper can't honor hw_vif_model image property."
Merge "Naming instance directory by uuid in VMware Hyper."
Fix bad vm_state change in reboot_instance()

Currently reboot_instance() in the compute manager
changes the vm_state to active before it does anything
else. This means that if there is an error in the reboot
operation then the vm_state is left as active although
the instance may not be running.

This change leaves the vm_state alone until the reboot
has completed

If the reboot fails but the power_state shows that it
is running then we log the fault but leave it in an
active or rescued state

If the reboot fails and the power_state shows that it
is not running then we set vm_state to error

See also https://bugs.launchpad.net/nova/+bug/1183946
which make recovery from an Error state possible.

Fixes bug: 1188343

Change-Id: Idabd358d3bcaf63e21ff59188f805143dbaf9ada
Merge "Add missing tests for provider_fw_rule_* methods"
Remove unused cert db method.

nova.db.sqlalchemy.api contained a certificate_get() method that was
unused.  It was not in the main db.api.  This method was also the only
reference to CertificateNotFound, so remove that as well.

Change-Id: Iba9aece2302e2f175e5d60e48b23959885a81c8d
Merge "Fix quota checks while resizing up by admin"
Enforce sqlite-specific flow in drop_unique_constraint

The nova.db.sqlalchemy.apy.drop_unique_constraint method has a
sqlite-specific flow for dropping unique constraints because it can't
use alter table like mysql or postgresql. The code is explicitly
checking if the db engine is mysql or postgresql and then falls into a
block which assumes the backing db is sqlite. This can cause problems if
the backing db is not sqlite.

This patch simply switches the checks so that the sqlite-specific flow
is only ran if the backing db is sqlite, everything else will default to
the 'alter table' flow.

Change-Id: I23b9bf33d18df3ac36106d5800a8ecdd1a4018df
Merge "Removed session from reservation_create()"
Merge "hardcode pbr and d2to1 versions"