Remove redundant architecture property update in powervm snapshot

During an instance snapshot if the architecture property is defined
in the image it is updated twice in the snapshot image.
The snapshot is created with the metadata values from the
"instance_system_metadata" table and then, if defined, the architecture
property is updated from the value in the base image in that moment.

There is no reason to treat this property differently from others.
Also, it didn't respect the "non_inheritable_image_properties" option.

This change removes the special behavior for the architecture property
in the powervm driver during a snapshot.

Fixes bug 1189969

Change-Id: I05ebcaef7b75387827917b5b223868794d98e0aa
Remove unused db api call.

There is unused db api call in NetworkManager
setup_networks_on_host() method, results from
this call not used, no specific exception raised,
this patch just remove it.

Change-Id: Icf898dcdda635a3a78c92e76ec0e19c6ab075ce1
Check libvirt version earlier

Running libvirt 0.8 causes an exception to be thrown before
has_min_version() is run, resulting in no error message about version
being logged.  This change moves the version check before the libvirt
calls are made.

Change-Id: Ifaae18c6686d72fb79fc32081c4087084ae8bbb9
Fixes: bug #1190232
Update to the latest stevedore

Use a version of stevedore that does not try to
install distribute.

The requirements change is in
https://review.openstack.org/#/c/32738/

Change-Id: I277a282ed86743a25138c431045af1f0ccb11b39
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Allow confirm_resize if instance is in 'deleting' status

Deleting an instance puts it into 'deleting' task_state.
If the instance is in 'resized' vm_status, this tries a
confirm_resize on the instance. confirm_resize currently expects
the task_state to be None. It should instead expect
None/deleting task_state.

Fixes bug: 1189391

Change-Id: I6a3f82eab9ed2242bfd38bc1ac760dbb4b3d8c4a
Don't advertise mute cells capabilities upwards

Fixes bug 1190473

Change-Id: Ic61b549869b1434df81407e499ec8b00ba8f328f
Remove trivial cases of unused variables (1)

Kill some of the variables marked as unused by flakes8. This should
allow to enable F841 check in the future.
Only trivial cases with no function calls and obviously pure functions
(like datetime.now(), or len()) are cleaned up here.

Part 1, split to reduce conflicts.

Change-Id: I82854349574ec4bcb9336aba626eefdaed81a8c8
Remove unused arg from make_class_properties.getter method

This patch simply cleans up an unused argument (typefn) from the
nova.objects.base#make_class_properties.getter method.

Change-Id: I6a1bd927bb799d00cc6f0b250609e90e3838fa29
Remove bin lookup in conf sample generator

As of 584b2f, the bin directory has been removed.
No longer need to handle bin/

Change-Id: Ic5013cd27d7e420a6a01d207546f7ac0258d62d1
Updates nova.conf.sample

Change-Id: Iabd856748258b224308588f5c54052df2e247a62
Replace utils.to_bytes() with strutils.to_bytes()

The to_bytes() function have moved to oslo.
Replaced/removed the to_bytes() function with the one in strutils

Change-Id: I14c33c6fb86db3088c11e02ce6e38ec022fad042
Fix flavor extra_specs filter doesn't work for number

In extra_specs_ops.match(value, req) function, req are
always string,but value of host capabilities may be number.
When filter host by comparing number with string,even right
os-extra_specs can't pass filter.
We should convert value to string to make the filter work
correctly.

Fixes: bug #1186881

Change-Id: I3e1ab60109673450caae3a7f0bc4a3610ae619ef
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
Improved tests for instance_actions_*

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

blueprint db-api-tests

Change-Id: Iae1033ae6e67f62f9353b4660468ea766af38035
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
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 "Remove unused db api call."