Downgrade log level when create network failed

We raised exception when create network failed because of exceed
quota, downgrade to debug level for those exceptions because
LOG.exception will generate a stacktrace.

Change-Id: I22446f08ee078c624970f233875874a67ea423b9
Should not delete active snapshot when instance is terminated

The instance might be deleted when doing snapshot, need to check
whether the snapshot is active state before delete it.

Change-Id: Ic12b8dfd05ad7f36831dd073cef746f094d8f2d0
Closes-Bug: #1329882
Catch permission denied exception when update host

When an existing non-openstack instance in the compute node contains
disk file which can not be accessed by nova non-root user, resources can
not be updated successfully when periodic task is running. Also the
nova-compute service could not be restared again. We should catch such
exception.

Change-Id: I75195417e123f135252470cf1322843830556b0a
Closes-Bug: 1322467
Don't follow HTTP_PROXY when talking to localhost test server

Unlike urllib2, requests honours HTTP_PROXY by default.  This meant
test_uri_length_limit's test queries to http://localhost:$port/ would
hit the wrong localhost when $HTTP_PROXY was another host - resulting in a
meaningless test scenario and apparent failures with HTTP status codes
other than the expected REQUEST_URI_TOO_LARGE (414).

This change forces requests to go direct for those test queries.

Closes-Bug: #1329614
Change-Id: Ida3424ca9a750bd2d3f2e81dc7dfacc2a334adf1
Fix detaching pci device failed

after booting an instance with flavor has pci device,
and then resize the instance, it will raise an "AttributeError".
this because in the method _detach_pci_devices(),
guest_config.devices will have more device not only pci, like disk.

Closes-bug: #1318891

Change-Id: Id52883a4f1fa7d05d61b31674acd1ca57918c3e1
Avoid traceback logs from simple tenant usage extension

Avoid generating traceback logs when invalid formatted datetime
parameters are passed to the simple tenant usage
extension. Exceptions have not been correctly handled by the
os-simple-tenant usage extension which results in tracebacks
being output to the log files. This patch correctly handles
exceptions as a result of badly formatted datetime strings.

Change-Id: Iecd42239357b96450b6530c0486b27c68995c37f
Partial-Bug: 1300972
Added statement for ... else

Statement for ... else was insert where it possible.

Change-Id: I3332e1bfff8f75c2ba862a2196c7d343530f465f
Object-ify APIv3 availability_zone extension

This makes the availablility_zone extension use the Service object
for looking up service details instead of a direct-to-database
call.

Related to blueprint compute-manager-objects-juno

Change-Id: I3091bc06a74e32871a743a831ab3db23220ae8f8
Merge "Don't follow HTTP_PROXY when talking to localhost test server"
Merge "Avoid traceback logs from simple tenant usage extension"
Merge "Downgrade log level when create network failed"
Merge "Added statement for ... else"
Fix log debug statement in compute manager

The patch does the following:
1. Ensures that there are no translations with log debug messages
2. Uses ',' instead of '%' with the parameters passed to the debug
   message
3. Aligns the debug messages

TrivialFix

Change-Id: Id35a969b92fb92487c8b169ff0729ab1851d30f1
Standardize logging for nova.virt.libvirt

 - add log translation hints for warning, error and info levels
 - remove use of % as a string formatter, use the log functionality
   instead
 - move from LOG.warning to LOG.warn

Log translation is motivated by oslo's move to prioritized
translation of strings, as documented at
https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation

Change-Id: I61ab8dbcdb73795538ea9d60c0c9d00c425ee1a5
Merge "Catch permission denied exception when update host"
Merge "Should not delete active snapshot when instance is terminated"
Merge "Fix detaching pci device failed"
Merge "Fix log debug statement in compute manager"
Merge "Standardize logging for nova.virt.libvirt"
Merge "Object-ify APIv3 availability_zone extension"