Support serial console access

This patch implements a console driver IPMIShellinaboxConsole that
uses ipmitool + shellinabox. The console can be accessed from a web
browser with the url returned from the driver. The console_utils
module is created for the common console functions.

The following new config options under the 'console' group are
introduced: terminal, terminal_cert_dir, terminal_pid_dir,
subprocess_checking_interval and subprocess_timeout.

When invoking the shellinaboxd console process, subprocess.Popen
is used instead of openstack.common.processutils because the latter
hangs for long running daemon process.

Co-Authored-By: Ling Gao <linggao@us.ibm.com>
Co-Authored-By: Matt Wagner <matt.wagner@redhat.com>

blueprint serial-console-access

Change-Id: I89a21e4d6969b91386896d1abc7035f9ba0232d9
Fix ironic node state comparison

Using "is not" is an identity comparison and doesn't compare actual
values. If NOSTATE were to be changed from None to a string, this
would likely break.

Change-Id: I96706e0a3a39971c3661210dbd13a8bc990a8933
Closes-Bug: #1315050
Implement more robust caching for master images

This patch introduces caching for master images, which
are no longer used. This patch also introduces clean up procedure,
which is triggered every time cache size increases or link
to master images is deleted. Algorithm is following:
- Images are eligible for deletion, if their link count equals 1.
  Images that has link count >1 are not considered for deletion,
  because it anyway won't reclaim any disk space.
- All images older than configurable TTL are deleted
- Then the oldest images are deleted, until size of cache fits
  into configurable value or no more images eligable for deletion.

As this change required rethinking how we cache images, I also
did a refactor and grouped related functions under ImageCache class.

Change-Id: I1c849fe209c4dbb15e075dbb34c4ea33010a8883
Closes-Bug: #1199665
Merge "Implement more robust caching for master images"
Merge "Fix ironic node state comparison"
Merge "Support serial console access"