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
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
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 bin lookup in conf sample generator

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

Change-Id: Ic5013cd27d7e420a6a01d207546f7ac0258d62d1
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
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
Add missing tests for nova.db.api.instance_metadata_*

blueprint db-api-tests

Change-Id: Ied09a4aacd3709cd4e63f939df3b812c6ad2533e
Add unique constraints to Cell.

In documentation: "name: Name of the current cell. This must be
unique for each cell"
Added unique constraint 'uniq_cell_name0deleted' ('name','deleted')
to Cell model and migrate sripts.
Added new exception `CellsExists`. Updated cell_create() in db.api.
Tests updated respectively.

blueprint db-enforce-unique-keys

Change-Id: Ib76e167089cb4756e4438613b49013ebf0874afe
Fix overzealous conductor test for vol_usage_update

The rest of the conductor tests are pretty unit-esque, in that
they don't test the underlying functionality. Rather, they confirm
that the various conductor APIs (public, local, rpc, and manger)
all agree and that the plumbing between them works as expected.

The test_vol_usage_update() test does too much, and as a result,
gets all twisted in how it mucks with mox to stub out utcnow()
without breaking the base test harness. Unfortunately, it seems
to fail quite often, depending on testr ordering, and has been
blocking the gate quite a bit lately.

This patch refactors that test to be like all the rest of the
conductor tests. It also removes the useless mirror test of
test_vol_usage_update_again().

Fixes bug 1190971

Change-Id: I815b25f6585786a8dbd5eefcfb39e2b4790641cb
Merge "Remove redundant architecture property update in powervm snapshot"
Merge "xenapi: ensure agent check respects image flags"
Fix instance obj refresh()

The refresh() method pulls a fresh copy of the instance but if any
fields changed when doing so, they are left marked as changes that
are not yet committed.

Also clarified the doc string for obj_what_changed() to state that a set
is returned, not a list.

This method is not used yet, so I didn't file a bug for this.

Change-Id: I83fbce07936fea2bc936441c5c6594f65da443a7
Imported Translations from Transifex

Change-Id: Iba2363891c83dda503518169617183930357ec80
Merge "Add missing tests for nova.db.api.instance_metadata_*"
Merge "Fix overzealous conductor test for vol_usage_update"
Merge "Fix instance obj refresh()"
Merge "Imported Translations from Transifex"
Make NovaObject support extra attributes in items()

An object could define a field as a property, which needs to get
included in items() and iteritems() for dict compatibility.

Related to blueprint unified-object-model

Change-Id: I2ca665e70fc6d3c9664ae7a74dffd99a56f6a8c1