Fix upper bound checking for flavor create parameters

Fix flavor-create upper bound checking so it uses platform-independent
32-bit max signed integer value instead of sys.maxint, which causes
problems on 64-bit platforms.  The DB int type is a 32-bit signed
integer, regardless of platform.

Change-Id: I82624121a45f6385d3ea9ae9c032109834584fac
Closes-bug: 1278939
Ensure parent dir exists while injecting files

Currently, if we inject a file to a not existing path,
the injecting will be failed with error 'No such file
or directory'.
Nova will firstly execute `mkdir -p` in folsom before injecting,
but this operation is lost from commit
72918415f2b6a241d6097a563aba55a849936591

This patch fix this bug by adding the `mkdir -p` operation as folsom.

Closes-bug: #1272829

Change-Id: If33a79c538e07cb25300db64ac7a9dee3d3b19c2
Removing redundant validation for rebuild request.

Any method decorated with wsgi.action will need to have
the said key, in this case 'rebuild', before it
reaches the relevant code block. If not, a key
error is raised when the wsgi.action code kicks in. This
code is at openstack/wsgi.py in the  _process_stack
method and subsequently the self.get_method method.
A KeyError is raised and caught. Removing the redundant
check for rebuild api.

Change-Id: I4baf920c7e1b3d51a91323f12d0802cedec77fe2
Remove and recreate interface if already exists

If a nova-compute machine restarts when openvswitch comes up it logs the
following warning messages for all tap interfaces that do not exist:

bridge|WARN|could not open network device tap2cf7dbad-9d (No such device)

Once the compute-node starts it recreates the interfaces and re-adds them
to the ovs-bridge. Unfortunately, ovs does not reinitialize the interfaces
as they are already in ovsdb and does not assign them a ofport number.

This situation corrects itself though the next time a port is added to the
ovs-bridge which is why no one has probably noticed this issue till now.

In order to correct this we should first remove interface that exist and
then readd them.

Change-Id: I1dc01604c5857941d9f35eb1e0c4d5103a56d57b
Closes-bug: #1270973
Related-bug: #1268762
xenapi: make session calls more discoverable

Its currently hard to discover what existing calls there are to
XenAPI, and the *_utils.py are getting very large.

Also, with the move to mock, it is becoming hard work testing multiple
calls to call_xenapi within a single method. Moving to this more object
oriented way of calling XenAPI should make writing tests with mock much
easier, and give us an obvious place to move some of simpler helper
methods in vm_utils and volume_utils.

This is the very first step in this direction. Dependent patches will
show how this can be used.

Part of blueprint xenapi-driver-refactor
Change-Id: I021fbedf2e84d58f24a3d9cb8fab0b906125f7c1
Refactor pool.py to remove calls to call_xenapi

In addition adding the Pool XenAPI object that is needed by pool.py

Change-Id: I1b417c469bbb2542a3fde40064142bde2b4dd400
When a claim is rejected, explain why

Previously, the Claim class offered #test which would return a Boolean
based on availability of memory, disk, CPU and PCI devices.

Now these tests are performed from the constructor and if any test
fails, an exception is thrown. All failure reasons are described in the
exception message. EG:

  "Insufficient compute resources: Free memory 8192.00 MB <
  requested 16384 MB; Free disk 45.00 GB < requested 50 GB; Free CPUs
  16.00 VCPUs < requested 17 VCPUs."

Change-Id: I5bf9c81bba747a6c164144e60a92dc6da2f98f4c
Closes-Bug: #1212768
Adds get_console_connect_info API

Implements: blueprint hyper-v-rdp-console

Currently graphical console access to Nova instances is limited to
clients which are part of Nova itself (novnc, xvpvnc, spice-html5).
The mentioned clients verify the validity of a console access token
with the following private API:
nova.consoleauth.rpcapi.ConsoleAuthAPI.check_token

The usage of a private API precludes the possibility of employing
external graphical console clients, including FreeRDP-WebConnect, used
to connect to Hyper-V instances via RDP.

This change adds a public API method that wraps the aforementioned
check_token private API. This allows external clients to obtain the
necessary protocol connection information by providing a token
previously obtained with calls to get_vnc_console, get_spice_console
or get_rdp_console.

Includes V2 and V3 API implementations.

Change-Id: Idd1e4f57b16bd1488f3b72bb064cef51321a7c79
Merge "Remove and recreate interface if already exists"
Merge "Fix upper bound checking for flavor create parameters"
Sync latest Guru Meditation Reports from Oslo

Nova fails to start on Windows due to non portable signal handling
(SIGUSR1) employed in this patch.

This patch enables the reporting feature only if signal is available
on the current platform.

Oslo commit: d3a285e33fa936cec5d14dfefa20dc03cc90ac18

Closes-Bug: #1286528

Change-Id: I070ab57b18b2bc43df5ec84c51ccb86be1ff0d2a
Merge "Ensure parent dir exists while injecting files"
Merge "Removing redundant validation for rebuild request."
Merge "xenapi: make session calls more discoverable"
Merge "Refactor pool.py to remove calls to call_xenapi"
Merge "When a claim is rejected, explain why"
Merge "Sync latest Guru Meditation Reports from Oslo"
Merge "Adds get_console_connect_info API"