Downgrade log when attach interface can't find resources

Downgrade the log when a resource (e.g. instance is deleted concurrently)
can't be found, no need to LOG.exception because an exception
is already raised and no need to log again.

Change-Id: I260e89c8deab11bc9707abbbbc7bb9a4f88640e3
Closes-Bug: #1322410
[EC2]Correct the return status of attaching volume

The EC2 API return volume's status as 'detached' in response when
attaching a volume.
It should be 'attaching' according to EC2's API docs, so we should convert
the volume_status or volume attach_status to ec2 volume attachment status.
The situation is similar in detaching volume.

Change-Id: Ifacf0ffcab49394def948d428c4c4c13d08152f0
Closes-bug: #1280572
Ensure live-migrate reverts if server not running

When the check to ensure a VM is running before attempting the
live migrate fails, it raises InstanceNotRunning. It should really be
treated in the same way as MigrationPreCheckError.

Along with fixing this bug, I have ensured the expected exceptions in
migrate_server are in sync with the except clause in _live_migrate.

This goes through to the API, ensuring the errors are not treated as
internal server errors, but are given a slightly more appropriate error
return value.

Currently the API returns 400 for all these kinds of errors. While other
error codes may be more appropriate, this change is concentrating purely
on ensuring we treat all the exceptions in the same way.

Change-Id: Iafe5026ef5a095d76e9864b489571e7bcfeb55f0
Closes-Bug: #1312132
versions API: ignore request with a body

Update the OS API versions controller so it ignores requests
with a body. Previously an incoming (unauthenticated)
request to the versions API would log a TypeError trace
in the nova-api.log file with the following message:

TypeError: index() got an unexpected keyword argument 'body'

Change-Id: Icc3ccfc537b13627b8d5ba43ae3ba91e34e08c9e
Closes-bug: #1306727
Fix for multiple misspelled words

In Nova code, few misspelled words have been found.
The misspellings python library has been used to scan
all nova code and find misspelled words.
This commit fixes all misspelled words found with this library.

Change-Id: I5919dddbbe812d8d32ecd8b249c1312249cd2a66
Closes-Bug: 1323730
Imported Translations from Transifex

Change-Id: Ida82c5bf325e21c16a99ce7dff686421af7a1784
Merge "[EC2]Correct the return status of attaching volume"
Merge "Downgrade log when attach interface can't find resources"
Enable flake8 F841 checking

This check looks to see whether a local variable
is unused. Fixed all of violators of said check.

Change-Id: I6ff349ca8d650ae7d6ebeeb116a1649b0db8f071
Sync periodic_task from oslo-incubator

We have not updated periodic_task in over six months and we should have
commit 47c9d60657be4ad58afa3c7e3ef88885a595c4c3 in nova.

Note that this does not include the gettextutils and log dependencies
since there are not functional changes in those modules needed for the
periodic_task changes synced in *and* more importantly, the changes
to gettextutils and log require pervasive changes to nova which should
happen when nova integrates with the oslo-i18n library for
blueprint i18n--messages.

Further note that this does not include jsonutils due to some
issues introduced with a change for python 2.6 that impacts some of
the unit tests in Nova and how strings are encoded with simplejson.
The details for that issue are in bug 1314129.  The jsonutils changes
are not related to the periodic_task changes being synced in so the
dependency is not functionally required.

periodic_task:
c63fd5a Make unspecified periodic spaced tasks run on default interval
f0dd798 Remove rendundant parentheses of cfg help strings
fcf517d Update oslo log messages with translation domains
051b9f3 Refactor unnecessary arithmetic ops in periodic_task
674cdaf Refactor if logic in periodic_task
b6b82c5 Use timestamp in periodic tasks
47c9d60 Don't share periodic_task instance data in a class attr
8b2b0b7 Use hacking import_exceptions for gettextutils._
c5a1088 Typos fix in db and periodic_task module
12bcdb7 Remove vim header

Related-Bug: #1319232

Change-Id: I5534e85ae8791c7c464357f7fd57b986ff74d092
Add unit test trap for object change detection

This adds a test that compares each object to a known hash that
covers the list of remotable method signatures and the field
definitions. Storing this in the code helps us assert that our object
definitions have not changed without a version bump. If someone
adds or changes a field or method to an object, this test will
fail, reminding them to bump the version and update the hash.

This adds a 'remotable' attribute to the methods decorated as such
so that we can detect them separately from local methods which
do not need a version bump.

Change-Id: I3e8bd387e36cec406baf4c6933baca9e1663d122
remove cpu feature duplications in libvirt

This patch fixes a bug in libvirt driver get_host_capabilities where
some features can be duplicated. In this patch we use the features returned
from baselineCPU as the only set of features.

Change-Id: Ib708e31e5ae14e93b384d2a8933079ca83ca8aaf
Closes-Bug: #1322702
Change conductor to cast to build_and_run_instance

With build_and_run_instance taking over for run_instance in the compute
manager, this switches over to calling it.  With this change the build
process will not cast back to the scheduler on a build retry.

This is the final part of a series of patches to build up the
build_and_run_instance method.

bp remove-cast-to-schedule-run-instance
Change-Id: Iefab71047996b7cc08107794d5bc628c11680a70
xenapi: move StorageError into global exception.py

We have our own exception for StorageErrors, and this is causing some
interesting dependency issues, so seems best to move this exception into
the more usual place.

Change-Id: I4f1f33e95f1050874ef828af9b35b0edbf8f0176
xenapi: remove calls to call_xenapi in volumeops

As part of the move to remove calls to call_xenapi, this removes calls
in volumeops. This makes the later refactoring and test coverage patches
much easier to write.

Change-Id: I384d7d85382551d32122d475768f015e8dfd8769
xenapi: refactor volumeops attach

Refactor the attach code, so its more readable.

At the same time, add some new unit tests to better cover the volume
attach code.

In a later patch we will remove the older mox tests, and dead code that
is now only left in volumeops to keep those old tests running.

Change-Id: Ic50dba5588bb968eca3ac2bf94c3eb719fa2cf6b
Sync oslo network utils

A new function was added to oslo-incubator for setting tcp keepalive
settings, and dependent projects can use it.

Ran update.py in oslo-incubator to copy changed modules into nova.
Removing synced changes for jsonutils because of issues with how
strings are encoded with simplejson that cause some of our unittests
to fail.

Changes are:
network_utils.py (which contains the function we need, others are deps)
edd73c9 Merge "Improve help strings"
fe3389e Improve help strings
8a0f567 Remove str() from LOG.* and exceptions
f61a4e7 Fix python26 compatibility for RFCSysLogHandler
da6d713 Revert setting oslo-incubator logs to INFO
0d18381 Set default log levels for oslo.messaging and oslo-incubator

gettextutils.py
9912e5d Add API for creating translation functions
6cc96d0 Fix test_gettextutils on Python 3

log.py
edd73c9 Merge "Improve help strings"
fe3389e Improve help strings
8a0f567 Remove str() from LOG.* and exceptions
f61a4e7 Fix python26 compatibility for RFCSysLogHandler
da6d713 Revert setting oslo-incubator logs to INFO
0d18381 Set default log levels for oslo.messaging and oslo-incubator

Current HEAD in OSLO:
----------------------------------------------
Merge: 2640847 e433899
Date:   Mon May 5 19:41:28 2014 +0000
Merge "Enable configuring tcp keepalive"
----------------------------------------------

Implements: blueprint configure-tcp-keepalive
Related-Bug: 1314129
Change-Id: Idd04ad4ad9a06ef76941dc5c1be41ac3ac8877a7
Merge "xenapi: move StorageError into global exception.py"
Merge "xenapi: remove calls to call_xenapi in volumeops"
Merge "xenapi: refactor volumeops attach"