Change unit test for availability_zones.reset_cache

Test_rest_availability_zone_reset_cache can not make sense
because the result of az._get_cache().get('cache') before
executing az.reset_cache() and after az.reset_cache() are
same.

This Patch will provide a reasonable test for it.

Change-Id: I7a27998bdf70f39077a5d79fc460974fc5806c3e
Closes-bug: #1258041
Set a sane default for state_path

This change sets a sane default to state_path and puts the previous
state_path for tests only.

Because the default value of state_path changed, if this one isn't set in the
configuration file, pybasedir is not more used as replacement but /var/lib/nova
is used instead.

UpgradeImpact
DocImpact
Closes bug: #1240879

Change-Id: I94502bcfac8b372271acd0dbc1710c0e3009b8e1
fix log message in APIRouter

In _setup_ext_routes(...) and _setup_extensions(...)[0], there are three
logs telling that I'm setuping extensions routes, and these are done,
those failed. At line3 in [0], every resource woulld be logged before
the line 6-7 skip (conintue in Python). So here should be that I'm
'extending' resource, not 'extended'. Similiar in line 38 and line 43,
these two should be what is done and what is failed.

So this patch fix the first log from 'Extended' to 'Entending', and in
third log, 'extending' to 'extended' instend which makes context log
more reasonable.

[0] http://paste.openstack.org/show/60246/

Change-Id: I2de66f1a8e09945e1915b61771a55af6b630369c
fix ips to 'ips' in APIRouter

Actually ips in `ips in init_only` would not be valued as True because
ips is a moudle object not a string. Fixing this to string 'ips' could
prevent potential issues and improve readability.

Change-Id: I74564349e1fef00e7430cfb0547b3ad87c8e471c
Remove unused code in test_attach_interfaces.py

"body = jsonutils.dumps({'port_id': FAKE_PORT_ID1})" is unused in
test_attach_interface_without_network_id(). We should remove it.

Change-Id: Id31b559752d57c9f55fd2bf0de909b8d8f9a0333
Closes-Bug: #1266617
Make nova/quota use keypair objects

Related to blueprint icehouse-objects.

Change-Id: Ic06d2337c7ef1b028d305d0a7ec354238c239380
Make image props filter handle old vm_modes

The ImagePropertyFilter would fail to build an instance if the image
used an older style vm_mode (e.g. 'pv') as described in
nova.compute.vm_mode.  This change will convert the vm mode string to
the current form.

Change-Id: Ibde37e28b02d9e866b286ea14c47a6a8411d94b4
Closes-Bug: #1276773
Fix potential fd leak

Always close the test socket.

Change-Id: Ic87b713a7791cf39ed5146754e1345fc662c894e
Cells rebuild regression fix

The introduction of 'preserve_ephemeral' in rebuilds created a
regression issue with cells.

Closes-Bug: 1281858

Change-Id: Ic8446e8611a41691d12c5dd0c4e1285a586248da
Fix unhandled InvalidServerState exceptions in server start/stop

Catch InvalidServerState exceptions in the server start/stop api
and return a 409 conflict rather than causing 500 errors

Closes-Bug: 1266379

Change-Id: I9d2437319d2cef93b9b10184e257acbd8eb45359
Fixed a problem in iSCSI multipath

Multipathing for attach volume and detach volume operations
doesn't work properly if there are different targets
associated with different portals for a mulitpath device.

Change-Id: Iab316526cf64de60325d90043f73fa3e83fafb4e
Closes-Bug: #1266051
ec2 api should check 'max_count'&'min_count' para

in ec2 api,run_instance method have not check para
about 'max_count' and 'min_count'

Change-Id: I852dac71e56c658a54b127053cba155e1a260a73
Closes-Bug: #1267382
Merge same db calls for some quota methods

db.quota_get_all_by_project is called twice in method limit_check()
and reserve(),
db.quota_get_all_by_project_and_user is called twice in method
get_settable_quotas() in nova/quota.py

Change-Id: Ie5e3a414d3d52964c16613f44fe60a7f68bc0c66
Closes-bug: 1277068
Calculate default security group into quota usage

Create the related quota usage when creating the default
security group for user.

Change-Id: Ide1de160814a5937f71e07f3ab10ce2bba8886f1
Closes-bug: 1271381
Ensure that exception raised in neutron are handled correctly

We are now logging exceptions so we need to use save_and_reraise.

The patch set has also added log messages for exceptions that were
raised. This will be very helpful for debugging and troubleshooting.
This is done in the following cases:
 - unable to access a port when validating networks
 - unable to find a requested floating ip

Change-Id: I946126c2fb5aa229f917f8cb36ecb23aab528e14
Add API schema for v3 rescue API

By defining the API schema, it is possible to separate the validation
code from the API method. The API method can be more simple.
In addition, a response of API validation error can be consistent for
the whole Nova API.

Partially implements blueprint nova-api-validation-fw

Change-Id: I3d08bc20e4c585dca1e218e8d97b208d158a3096
Fixed incorrect test case of test_server_metadata.py

Fixed incorrect test case about following points.
 * delete 2 test case because same test will be done
   in other part of same class.
 * fixed parameter according to test purpose.
 * fixed expected exception code.

Change-Id: I3116e9b4e22a86c583a531c8b8e46069f876296e
Corrected typo in metrics

Change-Id: If23292d83776be50f22f45c849fd45b7b04da7d9
Make exception message more friendly

Exceptions that get returned via REST api
should have more user friendly message,
users shouldn't have to know backend concept.
more detail,see bug.

Change-Id: Idc20680e46c36fa3441838177ce61b6f5e1d2979
Closes-Bug: #1263204
Fix multi availability zone issue part 2

In order to keep consistency with fixing in
code review:
I788782a9f21ec2672551f75123753175bb268586

adding aggregate az checking logic to guarantee
that aggregate updating and aggregate metadata
updating shouldn't be done when aggregate's hosts
belong to other az. So, when az conflict exist,
user should remove those hosts.

sync the changes into V3 aggregate APIs.

Fixes: bug #1200479
Change-Id: I18ad1ac22c6aee298ccc75c978b85241ae1ac616