Make sure report_interval is less than service_down_time

If service_down_time is less than report_interval, services will
routinely be considered down, because they report in too rarely.
Add check for service_down_time vs report_interval, if report_interval
is larger than service_down_time, automatically change
service_down_time to be report_interval * 2.5

DocImpact

Closes bug #1255685

Change-Id: I1be42e1826142b8f3f2c39f3734bef713a12a693
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
Recommend the right call instead of datetime.now()

Closes-Bug: #1258166
Change-Id: I92b94dbcd0405d8f2bb818ad1c44c4f4934c8bec
Fixes errors on start/stop unittest

The action name is incorrect on stop unittest, we should use "stop"
instead of "start".

Change-Id: I973e4f4591945f225e374797aebd1bbe00c3c9bd
Closes-Bug: #1257222
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
baremetal: set capabilites explicitly

ComputeDriver, base class of compute drivers, has dict capabilities
to show if the compute driver implements some functions. Compute
manger will check this with capabilities['has_imagecache'] or
capabilities['supports_recreate'] directly. If use compute driver
baremetal, there is code path leading KeyError. Let set capabilites
explicitly to avoid this.

Partial-Bug: #1261636

Change-Id: I5097d271df0d6ad419f530787d890288163d06c5
Clean swap_volume rollback, on libvirt exception.

Handling swap_volume command's rollback on the manager side
instead of the API, to allow clean rollback.

Change-Id: I7d5c1e66bf01fd12fcaa783c1c3c90d92b009aea
Closes-Bug: #1222656
Make _change_index_columns use existing utility methods

The _change_index_columns method is doing a drop/add index operation and
since we have utility methods to do exactly that already, just re-use
them.

Change-Id: I5706c4512b1324aab64f70cd053c464d9a50e233
Fixing availability-zone not take effect error

when add/remove a host to one aggregate or update aggregate
metadata incluing availability_zone, "OS-EXT-AZ:availability_zone"
property of some instances in the host can not show correctly.

The cause is that when getting availability_zone of one instance,
it will try to get the value from cache first, but unfortunately
the cache does not update or reset in time, and it will keep one
hour if we do not change it.

This patch will add update or reset after adding/removing a host
to one aggregate or updating aggregate metadata including
availability_zone.

Change-Id: I5dd07f876471b5faf8fb1016e25a861124b7cb6f
Closes-bug: #1240374
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
Fix test case with wrong parameter in test_quota_classes

The 'id' parameter is filled in the quota-classes request body in
unit test, but it is not necessary. 'id' is passed to the server
by the URL but not the body. This patch fixes this bug.

Change-Id: I4014264e16031382277f6f1b520556a2a2690ad8
Closes-Bug: #1266634
Use the full string for localisation

Concatenating localized strings is bound to be confusing.
Give the full string so that translations can be tuned accordingly.

Change-Id: I84a5fa2939c02add5468c4ab4b6f2c4ea1a5f8f0
Make nova/quota use keypair objects

Related to blueprint icehouse-objects.

Change-Id: Ic06d2337c7ef1b028d305d0a7ec354238c239380
Abstract add_timestamp out of ComputeDriverCPUMonitor class

Move add_timestamp decorator into ResourceMonitorBase class,
then other monitor metrics can reuse it.

Change-Id: I060353b9e194b1882549fec07fc2a486aeb1fce0
replace type() to isinstance() in nova

In nova/utils.py, a func use the "type" method to
determine the type. It's bertter to use the "isinstance"
method instead.this bug is fixed in glance:
https://review.openstack.org/#/c/65611/4

Change-Id: I10d25d2308436239c50cf3932c212e22c45f92a8
Closes-Bug: #1267300
XenAPI: Use direct IO for writing config drive

If you don't use direct IO when writing to the device, the unplug
immediately following this may not succeed as the device may still
be in use.

Also add a sync to ensure the device is not being used at the point
of unplug.

Closes-bug: 1259163

Change-Id: I68f09835648b36772a7839af9718123a4c60734f
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