xenapi: add a test for _get_partitions

Currently vm_utils._get_partitions is not covered by any unit tests.
This patch adds a unit test for that code.

Change-Id: I3ff612ca88250ad3d4d3e19aa12d299e12e442ed
Make compute manager use network api method return values

Calls to network api methods add_fixed_ip_to_instance() and
remove_fixed_ip_from_instance() return updated nw_info models
so there is no need to make separate calls to get this info.

This change refactors the affected code to avoid such extra
calls. Related methods in the neutron api are updated to return
the same information as their nova-network api counterparts.

Change-Id: I39dcf257ed5c101b13c2243266eed265c64e3c98
Closes-Bug: #1284345
Refactor unit tests for image service CRUD

Refactors the image service unit tests of the create() method to be unit
tests and not functional tests. There is no need to test whether an
image ID that is specified in the payload to the glance image service is
preserved; the unit and functional tests in the glanceclient package do
that, and besides, all this was testing was the behavior of the fake
glance client, which is pointless. There was also a test that created an
image and then tested the show method would raise InstanceNotFound if
not passing in the same instance name that was just created. This test
was removed, as ImageNotFound is already thoroughly tested in the show()
unit tests.

Missing in the existing unit tests was a test of failure conditions
resulting in error codes returned from the glanceclient.create() call,
and this patch adds a unit test that stresses the failure paths.

These new unit tests use mocks and assert that all code paths in the
create(), update() and delete() methods are fully tested.

Change-Id: I6d903979290b7d027c8dc66d2da712e1e1961a00
Related-bug: #1293938
Move _get_locations to module level plus tests

Moves the nova.image.glance.GlanceImageService._get_locations object
method into module level scope (the self argument was unused) and
adds full unit tests for the nova.image.glance._get_location() function.

Change-Id: Ib386330b70abe1e0353f1fafa3e68bc3e7a2d1b1
Partial-bug: #1293938
Merge "Refactor unit tests for image service CRUD"
Merge "Move _get_locations to module level plus tests"
Merge "Make compute manager use network api method return values"
Merge "xenapi: add a test for _get_partitions"