Prevent nova services' coverage data from combining into nova-api's

Now if combining a coverage report once, nova services' coverage
data are combined into nova-api's.
This renames nova-api coverage datafile to .nova-coverage.api and
creates a new coverage instance to combine when reporting.

Fixes bug: 1152475

Change-Id: I90b6535d490cf0123a127f8752986edd782ef37e
Make iptables drop action configurable.

Resolves bug 1013893 by allowing the setting of the iptables drop
action with a configuration flag. It is expected that this would be
used for run a LOGDROP action before actually dropping the packet.

DocImpact: the drop action for iptables rules can now be configured
for nova-network users with the iptables_drop_action flag.

Change-Id: I15720d2742955611929a4d7181a269795296e025
Add missing tests for db.instance_type_* methods

There was no tests in test_db_api for instance_type_* methods.

Add tests to ensure that all works.
Also these tests allow us to refactor work with session and
to add missing unique constraints.

Fix bug in instance_type_get_all, we shouldn't remove
is_public from input filters dictionary.

blueprint db-api-tests

Change-Id: Ia02d73e6ffd964d6edb605039eb95e9f90ff0482
Remove race condition (in InstanceTypes)

Soft delete all duplicate rows with the same name except one with
the biggest value in `id` column.

Soft delete all duplicate rows with the same flavorid except one with
the biggest value in `id` column.

Create UC on columns (name, deleted) and (flavorid, deleted)

Replace Select then Insert -> Try to Insert.

blueprint db-enforce-unique-keys

Change-Id: If66d2f1387c2b2748784bf7ac9746b8d755b70a9
Add missing tests for db.instance_type_access_* methods

There was no tests in test_db_api for instance_type_access_* methods.

Add tests to ensure that all works.
Also these tests allow us to refactor these methods.
For example add missing unique constraint on columns
(instance_type_id, project_id)

blueprint db-api-tests

Change-Id: Idfeda1685ef8c812c1211783aede15795b0d7caf
Adding netmask to dnsmasq argument --dhcp-range

By default, dnsmasq will try to guess the proper subnet size but
sometimes it will fail. This patch provides the network netmask
to dnsmasq via the --dhcp-range argument.

Fixes: bug #1154929

Change-Id: I74d62c837b5310004b9151851697e3ea3b475f92
Bring back colorizer again with error results.

This was actually a pretty simple fix. When I switched the base
test result class to testtools I lost the methods that were
printing out the errors at the end. This adds the (colorized!)
methods so errors print successfully.

fixes bug 1159116

Change-Id: Ib09d7e18ddf27015ff735a30137421d865382359
Switch nova-baremetal-deploy-helper to use sfdisk.

This patch changes make_partitions function to use sfdisk instead
of fdisk. Also added logging of cmd, stdout, and stderr should
command fail.

Fixes Bug 1088652

Change-Id: Ia2711a5450900c95598253f2a7b02e7c3e83a3d8
Authored-by: Chris Krelle <nobodycam@gmail.com>
List AZs fails if there are disabled services

Trying to list availability zones when there is a disabled
services fails with a 500 error

Fixes bug #1160841

Change-Id: Ibdb639f0d6a1a69a6a6331ee053c75449a16fc8f
Add a format_message method to the Exceptions

This patch adds a format_message method to the NovaException class that
will almost always do what a user wants, when they want to print out the
message of the exception.

Exceptions that are received through RPC are turned into an actual
exception classes by the deserialize_remote_exception function of the
nova.openstack.common.rpc.common module. This function then overrides
__str__ and __unicode__ methods of a new class to print the whole trace.
We still want to preserve this functionality (for logging) but do not
want to leak the trace back to the user in the HTTP response.

Based on the above, This patch attempts to establish a convention that
states: if you need to get the message of a NovaException subclass -
always use the format_message method. Only use str(e) or unicode(e) when
you suspect that they were overriden.

Initially this was attempted through adding a custom metaclass to the
NovaException class so that format_message cannot be overridden in
subclasses, however due to a bug in testtools - many tests were failing.
A patch was proposed to testtols to remedy this
(https://github.com/testing-cabal/testtools/pull/34) however until it is
merged, we cannot use metaclasses with our exception classes as they
cause tests to fail.

Change-Id: I0a399b9ab3227bad644b031c9b689fe0ce64586e
Use format_message on exceptions instead of str()

This patch changes all usages of unicode() and str() in the API layer
(and most other reasonable places) into a new format_message method.
This is done in order to avoid leaking the stack trace back to the
user through the Remote excepitons.

This patch deliberately avoids the EC2 api as the way how the EC2 API
handles responses is being worked on as part of another blueprint.

Fixes bug 1159755

Change-Id: I04a74682c4fac9a66ba25b52fd5c7af5e10e81e8
Merge "Bring back colorizer again with error results."
Make tenant_usage fall back to instance_type_id

In order to expose historical usage information about instances that
were deleted at the time migration #153 was run, we need to fall back
to looking up type information by instance_type_id.

This patch does that (only for deleted instances) and replicates the
previous behavior of skipping instances that have an instance_type_id
that points to a non-existent type.

Fixes bug 1161022

Change-Id: I39d30c59d1711d8f2a61c7a5e2545b3952e55dbe
Merge "Add missing tests for db.instance_type_* methods"
Fix quantum nic allocation when only portid is specified

A simple omission at the end of allocate_for_instance() was preventing
the function from returning information about the newly-allocated port
if one was not actually allocated from a network (i.e. if it was
provided as input). This fixes that and adds a test which would have
caught it.

Fixes bug 1160560

Change-Id: Ib0d7d91acfe5bd684cdfc072fe47c8115c2f91b3
Merge "Add a format_message method to the Exceptions"
Merge "Use format_message on exceptions instead of str()"
Imported Translations from Transifex

Change-Id: Iee6534fbffd02abd4cd116e308b25e1b5709dcb7
Show quota 'in_use' and 'reserved' info

We need show all the quotas related info, including 'in_use' and
'reserved'--not just the limit--when executing 'nova-manage project
quota'.

Fix bug 1160752

Change-Id: I25e10e58c6af705e2189550ad762e6f39bca342e
Merge "Adding netmask to dnsmasq argument --dhcp-range"