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>
Port certificates API to v3 Part 1

This changeset only copies the v2 files (implementation and test)
into the appropriate v3 directories unchanged. The copy as-is
will not be loaded by either the v2 or v3 extension loaders. The
second changeset will then make the changes required for it to
work as a v3 extension.

This is being done in order to make reviewing of extension porting
easier as gerrit will display only what is actually changed for v3
rather than entirely new files

Partially implements blueprint nova-v3-api

Change-Id: Ibdb3b444432fa707786e6bb43aaba61d2a3fc89f
Port certificates API to v3 Part 2

This patch contains the changes required to adapt the certificates
extension and the corresponding unittests to the v3 framework

Partially implements blueprint nova-v3-api

Change-Id: If4fe7e8524ba0181b50722281f594e0a80cd49ed
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
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