remove 2 unused function in test_volumes.py

2 fake functions are not used in this test file, remove them

Change-Id: I35d374cb2cbffc0ba6d2ac761b4f7fd20b47401f
Make compute use quota object existing function

There are several places which check the admin project_id and
user_id with instance project_id and user_id in compute.
There is already a helper function in quota objects, make the code
use the existing one.

Change-Id: I73e7e53ad15eda3788607a1be09c27215d09bda1
vmwareapi:Fix nova compute service down issue when injecting pure IPv6

Use vmware center driver to static inject pure IPv6 address, since
IPv6 injection function still not be implemented, but it should not
throw exception, it will impact nova compute service work

Change-Id: I8d0835623202d48466a97798312b67f049ffb6c8
Closes-Bug: #1286006
VMware: add in debug information for network selection

Add in some debug information to assist remote debugging of networking
issues.

Change-Id: I3cdeb56e0745d4a964e6c6069325fadee99c1088
Catch FloatingIpNotFoundForHost exception

When showing floating ips for a given host, the FloatingIpNotFoundForHost
exception isn't handled when no floating ips can be found for the host.
This patch fixes this bug.

Closes-Bug: #1289164
Change-Id: Ic25ffd66945fd40ba10d69515e0cbfeae840313c
Specify spacing on periodic_tasks in manager.py

Some methods in compute/manager.py were using the @periodic_task
decorator to ensure they were called regularly, but were not passing
in the `spacing` kwarg.  In this case the method can only be called at
the default rate, calculated as min(60 seconds, <spacings from all
periodic_tasks>), regardless of the poll interval set in config.

Although there was throttling code which prevented the methods from
executing too often, the case where we do want the method to execute
very often was missed.  This patch ensures that setting the config
values low will cause the method to be called as frequently.

Change-Id: I1530c8b3b6ac71f4d9e2e41188c0eca4a6556e01
Closes-Bug: #1274317
Remove unused method from fake_network.py

Excessive indentation caused it to never be parsed as a method. Turns out
it's not necessary anyway

Change-Id: I5cdbe75065bfce0bad0705a3bc52e49e041da07c
Add API sample files of "unshelve a server" API

Now there are not API sample files of "unshelve a server" and
"shelve-offload" APIs, and OpenStack API documentation also
does not show these APIs.
This patch adds these API sample files.

DocImpact
Closes-Bug: #1285482

Change-Id: Idf797eb6723b94abae71a77c12bc2bb9b330fa28
Add deleted_at attribute in glance stub on delete()

The glance stub used in unit tests sets the 'deleted' attribute to
True for the deleted image, but does not also add the 'deleted_at'
attribute, which should also be included, since that's how glance
actually operates. 'deleted_at' is missing from a few other places
as well; add it there for consistency.

Change-Id: I60a96f568d45a4f5fabdb146e0028c4cf680b9fa
Remove commented out code in test_cinder_cloud

Noticed this code while chasing down an info_cache issue.

Change-Id: Ie539d9160b07fa188444eec29658b1d97753a63e
Closes-bug: #1294480
Change initial delay for servicegroup api reporting

Initial delay should not necessarily be equal to
report_interval. Instead make it a reasonable value
such as 5 seconds.

This is so the surprising behavior of a service not
reporting when you start it up doesn't happen if your
report interval is configured to a larger value.

For example, in an environment where there are many
services it may not be optimal to have them all reporting
every 10 seconds which is the default. You may have them
report every 5 minutes. It is confusing to start up the
service and not have it show as available until 5 minutes
later.

Fixes bug #1226370

Change-Id: I85c4146bfa465fffaf89d4c2c74e6cb4ef84cee2
Catch NotImplementedError on Network Associate

When trying to associate/disassociate a network both for project/host
using neutron a 500 error is returned because the "associate" method is
not even defined in neutronv2 api.

The changes are:
   * Add missing associate method to neutronv2 api and raise
     NotImplementedError
   * Catch NotImplementedError on the API to return the proper error
     code on network associate/disassociate operations.
   * Catch NotImplementedError on os_network when associating a network

Closes-Bug: #1293539
Change-Id: I75b980500f0f171b065b7606baf201ab89848e92
Remove the nova.config.sample file

This file is not gated anymore and therefore it gets
out of date. Replacing it with a README that explains
how to generate it

DocImpact
Closes-Bug: 1294774
Change-Id: I2a72a005208a2c86d69ac461d72e54c53bd395cf
Fix the explanations of HTTPNotFound for new APIs

Nova wsgi framework gets "explanation" from HTTPNotFound exception and
outputs it into a response body as "message" attribute. Now some error
explanations are passed to HTTPNotFound exception without explanation
argument and they are not output to a response body. As the result,
the default message "The resource could not be found." of wsgi library
are output to a response body instead.

This patch fixes them to output right message to a response body.

The commit I80d3a2da6258e94c485ce024eb310a63bcf39773 has fixed this
kind of bug already, but it cannot cover the ones of new APIs. Then
this patch is necessary again.

Change-Id: Ia784e09cda986a421e83c2820dfd0a2267867cdd
Closes-Bug: #1285437
Raise error on nova-api if missing subnets/fixed_ips on networks/port

Previously, if one would launch an instance on a network that did not contain
any subnets or on a port that did not have a fixedip the instance would fail
to boot resulting in a SecurityGroupCannotBeApplied  on the nova-compute node.
This patch adds checks to validate networks so it fails on nova-api and
the user will be able to see why from the response.

Note: a patch to fix the neutron port-security-enabled extension will
follow which allows one to boot instances on networks without subnets
and ports without fixedips.

Change-Id: I104d5234b34726e5f5819fc2a81eef55e3c70f42
Closes-bug: 1252410
Catch HostBinaryNotFound exception in V2 API

When updating a service with a wrong host or binary name,
HostBinaryNotFound exception will be raised.
However the ServiceNotFound exception which won't happen here
is caught instead of HostBinaryNotFound.
The similar fix has been merged in V3 API.
I64b138bad74c39d087addcd766b890c4076a2ce8

Change-Id: I37cf7a56c5478bb1273ef038bb197d80af0ae7b5
Closes-Bug: #1273139
Revert "VMware Driver update correct disk usage stat"

This reverts commit 9adba6727bbec051c1437ee95367ecb97b207f35.

Reporting aggregate storage space is not correct, since the nova
scheduler will assume that it can send a guest of that size to
the node, which the node will be unable to support due to lack of
contiguous disk space. The previous behavior was correct, where
the largest available chunk was reported.

Change-Id: Ia3a6e3f502282d44473d4908f68d71a97167e85f
Merge "Catch HostBinaryNotFound exception in V2 API"
Merge "vmwareapi:Fix nova compute service down issue when injecting pure IPv6"
Merge "Add API sample files of "unshelve a server" API"