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
Add tests for nova.db.api.security_group_rule_* methods.

blueprint db-api-tests

Change-Id: I20b63683da78bcb99e1f88cc10ca71a64f1f17a9
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 _is_precooked pre-cells Zones hacks

pre-Cells Zones used to talk to child zones via the API and thus things
didn't need to be re-serialized for API responses.  The hacks for this
were left around and should be removed.

Fixes bug 1192006

Change-Id: I0b0c7fcad49412659d97037fc3cc8594b46668f1
Merge "Remove _is_precooked pre-cells Zones hacks"
Merge "Add rpc client side version control."
Merge "Remove trivial cases of unused variables (1)"
Merge "Add tests for nova.db.api.security_group_rule_* methods."
Servers API for the new BDM format

This patch makes the nova API aware and able to accept the new block
device mapping format introduced in
If30afdb59d4c4268b97d3d10270df2cc729a0c4c when booting an instance.

The compute API create method will still convert these back to the
legacy format for the time being until the compute API will now how to
take advantage of the new format.

blueprint: improve-block-device-handling
Change-Id: I2c1b63e41deca26f727fb9ed912a55494db9c76c
Add basic BDM format validation in the API layer

Adds the basic sanity checking for the new BDM data format when it's
passed in to the servers create method. Also make block_device routines
that raise IvalidBDMFormat error add a brief explanation to it that can
be reused to send more informative validation errors to the user.

More comprehensive validation that will take a look at the request as a
whole, and take into consideration all the metadata, will be done in
the compute API create method in the subsequent patches.

blueprint: improve-block-device-handling
Change-Id: Ie4c2c9a219be91faa07106f820a728ca9ac42e1b