Fix typos in nova/api code

blueprint fix-nova-typos

Change-Id: Idd9c5458c5fc0facd9f3c55f907acb7acc4c1b0f
Move exception definitions out of db api

The two exceptions, NoMoreNetworks and NoMoreTargets, are defined
in nova/db/api. While NoMoreTargets is unused and can be removed,
NoMoreNetworks are still used and should be moved to exception.py
where all other exceptions live.

This came up during review of https://review.openstack.org/#/c/42980/
where compute manager would need to import nova.db to make use of
NoMoreNetworks.

Change-Id: I57f0a081d2fea35394421932ae7d2a3e67540a31
Remove unused method _get_res_pool_ref from VMware

This method has been moved to vm_util.py in commit
9408d79e7413aadcba52a61b7a33164090785e4f, so we can
remove it safely.

Change-Id: I6c192414c58c30ceec206937694ae92a3eea4d2d
xenapi: stop using get_all_vdis_in_sr in spawn

Currently when trying to find a cached image, the very expensive call to
get_all_vdis_in_sr is used, where we could instead fetch the VDI
directly using a more targeted query.

Now we are fetching the VDI by name_label we must ensure to clear the
name_label on newly created VDIs to ensure they do not get picked up by
later calls to _find_cached_image().

Fixes bug 1221292

The above code that checks for _find_cached_images has race conditions
where its possible to end up with two VDIs returned. To stop this
happening the code to create the cached images is now synchronized on
the image being fetched.

Fixes bug 1226073

Change-Id: I534fb8f42b00b5d39dc17dd5fee297144b5f379a
xenapi: removes sleep after final upload retry

This change removes the sleep that happens after the final retry of
uploading an image.

This change also ensures the unit tests do not take too long by stubbing
out time.sleep.

Closes bug 1239707
Change-Id: I16b6639e3231d41fa476218f406fa5b3abdfaf71
Merge "Fix typos in nova/api code"
Merge "Move exception definitions out of db api"
Merge "Remove unused method _get_res_pool_ref from VMware"
Merge "xenapi: removes sleep after final upload retry"
Merge "xenapi: stop using get_all_vdis_in_sr in spawn"
xenapi: post install scriptlet to rpm

A freshly installed XenServer requires some modifications in order to be
able to run OpenStack. Nova contains an rpm specification to create a
package with the dom0 plugins, however installing the rpm is not enough.
Some more actions need to be taken:
 - create /images, link to a directory within the local SR
 - setup an ssh keypair, and authenticate it with the host
This change adds a post script to the nova plugins rpm spec file, so
by installing the rpm on a XenServer, it is ready to run OpenStack, no
further manual actions needed.

Change-Id: Id57e3a3ab2782550468c6aa4c01059ceb7cc81ab