Update invalid state error message on reboot API

This change adds more detail to the error message
when a request to soft reboot an instance in an
invalid state fails, indicating that specifically
soft reboot is the request that failed, when
a hard reboot might still succeed.

Closes-Bug: 1365683

Change-Id: I4b12aa261d1c4fa05bacd5311793ed6e0478e59b
Add unit test to os-agent API

This patch adds unit tests for os-agent API to test updating
and deleting a agent with not existing agent id.

Change-Id: Id266b0449deff6bd3715cbd2b5403031a2e34eeb
Fixes AttributeError with api sample test fail

Avoid AttributeError which could be raised with api sample tests
when a string is expected but a non string type is returned
instead. This makes debugging api sample test failures easier as
the expected and actual values are displayed in the error message
rather than an AttributeError exception.

Change-Id: I4d124e4d80779c4431926619f0ca876a513a8462
NIST: increase RSA key length to 2048 bit

According to NIST 800-131A, RSA key lenght for digital signature
must >= 2048 bit. Now we use 1024 bit key to generate x509 cert
file. Need to increase the key length to 2048 bit.

Change-Id: I59f614b5d8a79f9e0a96503867cfca176be5c757
Closes-Bug: 1369487
ironic/baremetal: add validation of host manager/state APIs

Add tests to ensure the ironic & baremetal HostManager and
HostState sub-classes comply with the API contract defined
in their parent class.

Related-bug: #1369151
Change-Id: Ic2cf17c59c06fe2222db4bc5ea0e68f87c4399e9
Record instance faults during boot process

Once a build makes it to the compute manager build_and_run_instance
method no instance faults were being recorded.  This stores the instance
faults appropriately when an instance is placed into the ERROR state.

Change-Id: I348b539d0b5874bac3f7443e6dd4524264ce9766
Closes-Bug: #1355922
libvirt: convert test_dmcrypt to avoid DB usage

Nothing in the dmcrypt test case uses the DB, so it was
incurring the DB setup penalty for no gain. Switch to
use NoDBTestCase reducing time from 1.7s to 0.09s

Partial-bug: #1369516
Change-Id: Ifd4b919f60f48f691d83cedb6ce7ea18c98636ad
libvirt: convert encrypted LVM test to avoid DB usage

The EncryptedLvmTestCase test case was depending on the DB setup
for no purpose. This masked a bug whereby the test was relying
on the implicit import of nova.keymgr.conf_key_mgr config opts.
Explicitly import the config opt and remove DB setup. This
improves performance from 1.8s to 0.6s

Partial-bug: #1369516
Change-Id: Icd5c27b3ac6cab5a014fae65904bbbefb5343282
libvirt: Unnecessary instance.save(s) called

When spawning an instance there may a considerable amount of
instance.save() called. This is not necessary as the compute
manager will update the instance after the spawn method has
successfully completed.

Change-Id: I61610b3869caeb7822eab3f2d09335744b75db28
Closes-bug: #1366548
FIX: Fail to remove the logical volume

The logical volume can not be removed when delete VM error. I look at the
code, found that parameter is a list in the libvirt's lvm, but in
imagebackend, parameters passed is a string.

Change-Id: I222f6c5cfe5be63105f2fd8afd7ccd209ca2e5f7
Closes-Bug: #1358552
Address nits in I6b4123590

This addresses the alignment and log message
comments in change I6b4123590.

Change-Id: Ic1490bdbe660d8594538a1480eb03311edf00d83
Handle volume bdm not found in lvm.get_volume_size

We're stack tracing in successful gate runs because of a race when
deleting an instance and when the update_available_resource periodic
task is running.

When we hit the race, the volume that's backing the instance is deleted
and the periodic task (virt driver) is trying to get the current
information about the volume, which no longer exists and we fail and
short-circuit the update_available_resource task.

This change adds a decorator which checks if a ProcessExecutionError is
due to the device no longer existing and if so, raises
VolumeBDMPathNotFound, and applies that decorator to the get_volume_size
method.

Related-Bug: #1371677

Change-Id: Ic452df82c61087efda8d742e030076421c0c813b
Handle VolumeBDMPathNotFound in _get_disk_over_committed_size_total

This handles the VolumeBDMPathNotFound error bubbling up from
_get_instance_disk_info during the update_available_resource periodic
task.

Related-Bug: #1371677

Change-Id: I10c20f3f5f96003fe69fcdc9133c661e6dc009b4
Add unit test for glanceclient ssl options

Commit 0fe6997856ae39afcbed0ad53cc2916ec369c9d5 added code to pass ssl
options when creating the glance client but was missing a unit test.

Related-Bug: #1279381

Change-Id: Iaf1b8e59d98382c630b8e4e13234b9028a873482
Merge "libvirt: convert test_dmcrypt to avoid DB usage"
Merge "libvirt: convert encrypted LVM test to avoid DB usage"
Scheduler: add log warning hints

Add hints for log warning messages.

Change-Id: I699ed0bd0ebbea71c3408c2f23472a91b9f6a89a
Merge "Address nits in I6b4123590"
Merge "Add unit test to os-agent API"
Merge "Fixes AttributeError with api sample test fail"