Update openstack/common/lockutils

The following commits are in this update:

79e6bc6 fix lockutils.lock() to make it thread-safe
ace5120 Add main() to lockutils that creates temp dir for locks
537d8e2 Allow lockutils to get lock_path conf from envvar

Change-Id: I2190d0aae72ef4a29daf8f7d960da82a33b331b4
Remove deprecated instance_type alias from nova-manage

Was deprecated in Havana, so now that we are in Icehouse lets
remove it.

UpgradeImpact
Change-Id: Ieb3775e0a43084d00624f9e1d8b879c312e32b3c
Handle UnicodeEncodeError in validate_integer

validate_integer can be potentially passed user
supplied data which causes a UnicodeEncodeError
exception during validation rather than just ValueError.
This change handles the UnicodeEncode exception
so validate_integer treats it as invalid input.

Change-Id: I5177789299b02448ed53e1b7fc23ccdaee1b70d3
Partial-Bug: 1243037
Fix docstring on SnapshotController

Change-Id: I66a8b15ef700253bbad54ee3955550aeb2a522b7
Closes-Bug: #1257151
Deprecate/remove scheduler select_hosts()

This call is no longer used and can be removed from the scheduler api and
drivers. For backwards compatibility, the existing manager method is kept
but instead call driver.select_destinations() and convert the result to
the old format.

Conductor manager, as the last user of this call, used it to select
a target for live migration, but now instead makes calls to
select_destinations() to get the same information. The related change
to conductor manager is here: https://review.openstack.org/#/c/52311/

Change-Id: I702515a086e7f33c48fa9ee106271c868b660540
Add boolean convertor to cells sync_instances API

cells sync_instances API contains "deleted" as the parameter, and the
parameter should be boolean. There are the other boolean parameters
such as "on_shared_storage" of evacuate API, they can be passed with
either boolean or string(e.g. "True").
For the consistency of whole Nova APIs, this patch adds boolean conv-
ertors to cells sync_instances API.

Change-Id: I4776539cfd723f302d10350757e1c341384c9ba2
Closes-Bug: #1261287
Changed error message to match usage

InstanceDiskTypeTooSmall is not the proper error message, it should be
FlavorDiskTooSmall.

Change-Id: Id928015534161cba296c17114ef2d19d96e8781d
Allow some instance polling periodic tasks to hit db slave

If your deployment has a slave configured, poll_*instance* periodic
tasks will send their reads to the slave. If you have no slave
configured, there is no change to behavior.

Note for developers, I have targeted all the easy tasks. By this I
mean tasks that were already using the InstanceList object and the
get_all_by_filters or get_all_by_host methods. I will slaveify the
other tasks in seperate reviews since they also require conversion
to using objects.

Change-Id: I4bead5d350d633d726d4564b4bc1baec2e2977b7
Partially-implements: blueprint periodic-tasks-to-db-slave
Spelling fix resouce=>resource

Change-Id: I369d925573e6ce7b48f610051f3b53a4afbb3d0d
Do not use contextlib.nested if only mock one function

There are some test cases in test_compute_mgr.py using contextlib.nested
to mock up functions even there is only one function needs to be mocked.

We should use mock.patch.object directly if only mock one function.

Change-Id: I30f05d0dcb442d426358b673f0e638ace8b85e0e
Closes-Bug: #1263602
Fix image cache periodic task concurrent access bug

This fix catch the exception and ignore a disk file absent
exception. It will defer the image cache clean to next round
image cache periodic task because it's not harmful.
Refer to detailed info, log analysis and root cause in defect.

Change-Id: I3a431bf389658f976edf5c847c04b7e0aac496fd
Closes-Bug: #1261442
Add API schema for v3 agents 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: Iae1bff0e853e1dc597ebdca07efeb477b105469e
Add API schema for v3 flavor_access 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: Ia3b4fa951c2f3867685ea6a619a39ac47dc4c3e6
Add API schema for v3 keypairs 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: I484fc2807721b5bfe0f1a11c3811b99a13d920aa
Catch InstanceIsLocked exception on server actions

If the server is locked, server actions raise 409 error, and the error
message is like "Instance is in an invalid state for 'pause(action name)'". The
error message is inappropriate, two points:
1. the state is valid for pause
2. the message doesn't tell that the instance is locked

The patch fixes the problem, and will modify on v2 and v3.

Change-Id: I7e21037b9abca5a3fd0f64dd5621e88dcf1a3c21
Closes-Bug: #1256873
Add API schema for v3 extended_volumes 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: If0ebee7a8661baae9eea1e7ce586695b9e575afc
Fix lxc rootfs attached two devices in some action

During resizing/rebooting a lxc container, create_domain action
will be called and lxc rootfs will be attached to device again.
So before this action, We need to teardown the container to
make sure lxc_root_device is detached when container is destroyed.

Closes-bug: #1243083
Related-bug: #1208387

Change-Id: Idd1862c7f212dc253b6273b07b020c86a94e658e
Return policy error, not generic error

When nova net-create and net-delete are prohibited by policy, we should
raise policy violation error (403) to the user instead of service
unavailable (503) error which is incorrect.

Closes-Bug: #1260905
Change-Id: I2edc0eb09f1dc192ba47184ed24fc49e4fcd4b79
Cleanup the flake8 section of tox.ini

* Stop ignoring F403 as we have no cases of it anyway
* Cleanup the comments to make it clear what is ignored on purpose and
  what is ignored until we clean up the code.

Change-Id: I2500e2db70b9c71fbed781d8f7b7c80eee45140f
libvirt: stop overwriting LibvirtConfigCPU in get_host_capabilities

Currently, LibvirtConfigCPU configuration is being overwritten with baselineCPU
output. However, baselineCPU never reports the ARCH and other relevant fields,
that is being set in LibvirtConfigCPU by the LibvirtConfigCaps.
The absense of the arch field is causing the bug below.
Fixing it to simply update the LibvirtConfigCPU.

Change-Id: I9dd06fa44a232a333609fa115d05ad8822e21c0c
Closes-Bug: #1266534