make QuantumV2 support requested nic ordering

fixes bug 1064524

The QuantumV2 did not honor nic ordering, so nics were attached in
Quantum's db natural order.  This patch sorts the networks honor requested nic
ordering when Nova calls the V2Quantum API.  Unit tests have been updated to
confirm ordering is honored.

Change-Id: I44a6a4736c78e86e83b6e682e63f93a5b47652da
Read deleted flavors when using to_xml()

Fixes bug 1073736

Extend get_instance_type to accept an optional flag to return inactive
flavors and use this within to_xml().

Change-Id: Id01724a85d9aff3b32b3502be06a84578fa8f4df
Increased MAC address range to reduce conflicts

Increased the 4th octet range from 7f to ff, making it consistent with
Quantum. This also reduces the probability of a MAC address conflict.

Fixes LP: #1050924

Change-Id: I801a852110c0a35e5a6a31f359df75475a21fd4a
Ability to specify a host restricted to admin.

Fixes bug 1070880

There is functionality in place, which uses the
format "az:host" on the --availability_zone
parameter to a create request to force scheduling
of an instance onto a specific host. However,
this is limited to users with Admin context.

This fix alters this behaviour to use a specific
policy action allowing fine-grained control over
which users have access to this functionality.

Change-Id: Ibb0e43492dfa2699ab26318736ca55a60b7b4468
refactor: extract _attach_mapped_block_devices

Extract method to remove code duplication.

Change-Id: I032883984ec33051034a30caf3c56520edf58f12
Add xenapi host_maintenance_mode() test

This bit of code is currently untested (except for the most
basic stubbed-out case).

Change-Id: I7193152480ed678c89be7b7dda5edf034f5dad2e
xenapi: Make agent optional

Related to blueprint xenapi-config-drive

As config drive and agent are doing similar operations, this change
makes it possible to disable agent, thus config drive could perform
these operations.

Change-Id: I3fa536cb0fb3b60ff5bc035be9d86afe35905240
improve sessions around floating_ip_get_by_address

improve session handling around calls to floating_ip_get_by_address.
Removed 'session' parameter from public method calls, and replaced
private calls with new method _floating_ip_get_by_address.

Some existing calls to floating_ip_get_by_address were easily rewritten
into a simple model_query().update() call and thus removed. Others can
be cleaned up later.

blueprint db-cleanup

Change-Id: I4db11e6d7fda43420bca800c44c34efdefb8038a
add doc to standardize session usage

Add doc to nova/db/sqlalchemy/session.py to outline some best practices
when using sessions within Nova, and also shows some things to avoid.
This will form the basis of much of the db-cleanup work.

Change-Id: Ib91a7fa3263e415fb6b8f88e79325c730550e576
move python-cinderclient to pip-requires

python-cinderclient is now actually a requirement, move
this from test-requires to pip-requires to reflect that.

Fixes bug #1074085

Change-Id: Iea6c58faab2462d137049d690d58d951bd4e2c9e
xenapi: place boot lock when doing soft delete

If an instance is soft deleted a boot lock should be placed to ensure
it doesn't get restarted by accident.

Change-Id: Id46b8758f71d122d2a9cf7ae172fc138974bc315
Forbid resizing instance to deleted instance types

Sets read_deleted="no" while get_instance_type_by_flavor_id to forbid
resizing instance to deleted instance types

Fixes bug 1068539

Change-Id: I3859f63a33391a840e041f06f08af361b6d64157
Move parse_args to nova.config

The flags module will eventually be removed and this is a first step
towards that.

Change-Id: I729b08900e53e2ae6db10633dcff3be59720fa6f
Remove flags.DECLARE

The cfg.ConfigOpts class has an equivalent method, so lets use that.

Change-Id: I5860230336d00d7531a0ffd255c766ff77661625
Switch from FLAGS to CONF in bin

Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.

We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.

Change-Id: Id0c59b2dc8002ec89ccbc5e5d7986fb68d3a693d
Switch from FLAGS to CONF in nova.api

Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.

We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.

Change-Id: I11fda86471fbf02eec342b95ec314792388307e3
Switch from FLAGS to CONF in misc modules

Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.

We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.

Change-Id: Ib110ba8d1837780e90b0d3fe13f8e6b68ed15f65
Switch from FLAGS to CONF in nova.network

Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.

We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.

Change-Id: I20b45c6325e9a03b8800032f761c2b6101376e8e
Switch from FLAGS to CONF in nova.scheduler

Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.

We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.

Change-Id: Ia3f66aec300fd88e91cef926da735f9e95aa2cc2
Imported Translations from Transifex

Change-Id: If46e19338fa5a98b5748b6c30aa365cab17ccc30