Correct update-image to image-update in samples

Change-Id: Ie68346e092a8d94852d51e02425df43befa5df08
Add cloud-user to non-root user list

RHEL and CentOS cloud images use 'cloud-user' as the default user for
login. This adds support for trying that user if root does not work.

Change-Id: Ie9e4276800408dee5941971d49da35252f9a74ee
Merge "Correct update-image to image-update in samples"
Create new provider managers on image data changes

Previously only non image provider config would force nodepool to create
a new provider manager. There are cases when it is useful to  have
nodepool create a new manager when the image config changes. For
example, when you want to add an image or change the flavor of an image.

Add additional checks to see if the list of image names has changed and
if all the image names remain the same check if any of their properties
have changed. If any of these things have changed create a new provider
manager.

Change-Id: Ic0732453e12069d5d50a56dea0037817e978dad4
Merge "Create new provider managers on image data changes"
Don't accept tasks for stopped managers

In case a provider manager is being replaced due to a configuration
change, raise exceptions for any tasks submitted after it is stopped.

This will probably cause many errors, but they should already be
handled and servers will eventually be deleted.

We can minimize the disruption by making the provider managers more
adaptable to changes, but this stopgap measure should at least fix
the current problem we are observing with threads that get stuck
and never complete.

Change-Id: I3d190881ede30480d7c4ae970a0cb2dd07c3e160
Merge "Add cloud-user to non-root user list"
Use except x as y instead of except x, y

According to https://docs.python.org/3/howto/pyporting.html the
syntax changed in Python 3.x. The new syntax is usable with
Python >= 2.6 and should be preferred to be compatible with Python3.

Enabled hacking check H231.

Change-Id: Ide60f971493440311f1dcc594e33d536beb925e5
Support provider AZ lists

Apparently not all clouds will schedule AZs as expected by nova. It may
be the case that an AZ is hard set on the provider side when no specific
AZ is requested. Add AZ support to nodepool so that it can request AZs
and better load balance across AZs provided.

Do this by randomly selecting an AZ from the list of AZs provided in the
config. This should give us a good distribution across all AZs. If a
differently weighted distribution is required a nodepool provider object
can be created per AZ with a single item AZ list.

Note this requires an update to the nodepool database.

Change-Id: I428336ad817a8eb7d311a68767849aab0bcf015f
Display node AZ in `nodepool list` output

Add the availability zone data for a node to the `nodepool list` output.
This should aid in debugging of AZs.

Change-Id: If861e666c5d9eec4f4f1ddf1bb431fb06436b6e6
Merge "Use except x as y instead of except x, y"
Check the returned image status

We did not check the status of a completed image build; if it
went into the ERROR state, we assumed it worked.  Check the return
value.

Change-Id: I2acf8ac4c5641aa69932230d3414e92620f6e735
Prevent listserver tasks from piling up

If a bunch of threads waiting for servers all decided that the
server list was expired at around the same time, they could all
end up submitting server list tasks which defeats the caching.

If listing all servers was slow, that would only exacerbate the
situation.

Instead, wrap the actual list server API call inside of a
non-blocking lock to make sure that it only happens once per
period.

Change-Id: I2a09ab3a226001d9de4268d366f65ef3e69cdd0d
Log task manager queue length

A long queue isn't necessarily bad, but more information could be
helpful.

Change-Id: I34d6bb5c1627af1fbc700458d8950add296bc1bc
Log task durations

Change-Id: I87c6f870ccb806d3484b38ac123ac89201a854cd
Add warnings about the installation of libzmq1

With the incorrect compile-time options for libzmq1, pyzmq
will give an error such as the following:

    AttributeError: Socket has no such option: RCVTIMEO

Change-Id: I719a8de89b26dba974d7af8d631b7cdd729a074b
Increase watermark sleep in tests for reliability.

The nodepool tests depend on watermark sleep being long enough that all
of the fake nodes are marked ready before the next deficit check. If it
is not long enough then the tests may boot extra servers causing asserts
in tests to fail.

Increase watermark sleep to one second from half a second and let each
test sleep for three seconds before checking node states.

Change-Id: Ia94527b46bad26b184af8fa02b3a1e2a1f7a3430
Remove libzmq-dev from dependency list

System installed library of libzmq-dev will have libzmq1,
which doesn't support RCVTIMEO in some linux distros, eg.
ubuntu 12.04 and pip will install libzmq and compile the
supporting version anyway so remove libzmq-dev from dependency
installation by apt-get in README.rst.

Change-Id: Ifd67c7ded5db7dbb82624d2aa08843278f2de72c
Merge "Remove libzmq-dev from dependency list"
Merge "Add warnings about the installation of libzmq1"