Use utils method when getting instance metadata and system metadata

Change-Id: Idab1ba25a8ec4c7dcc9efbb9d86e7248ae3c351e
libvirt: Review of the code to use module units

In some places we do not use the module units to refer
bytes type.

Change-Id: Ia89684bb6531bfdcee565cb1bdd33ed943ec3971
xenapi: clean up step decorator fake steps

In vmops.py there are some fake methods to adjust the number
of steps used for a resize up/down.

 + This patch adds to the method used to create steps a new parameter
   'total_offset' to adjust the offset of total steps.
 + This patch also adds a missing test for a successful resize down.

Change-Id: I506045442d893e91b03ce33e4aab9930966c8ec2
Closes-Bug: 1235108
Make nova-network a "conductor-using service"

In order for a service to reliably use conductor at startup, it must
wait for conductor to become available before making any requests.
This is indirectly controlled by the "db_allowed" flag to the service
startup. This should be equivalent to the "use_local" setting in
the conductor group, so this patch sets this for network so that a
subsequent patch can introduce a conductor-using call in init_host().

Note that compute was incorrectly passing this flag always as False,
so this patch fixes that up as well.

Related to blueprint nova-network-objects

Change-Id: I9a98fb943895d0d2d359e0d9d38f09fb0f6ddd5a
Make nova-network use Network object for get-all-by-host query

This makes nova-network use the NetworkList.get_by_host() instead
of the direct-to-database query.

Related to blueprint nova-network-objects

Change-Id: Id94415ea650bce8009ea2db98f5d175206f7e509
Make nova-network use NetworkList for remaining "all" queries

This makes nova-network manager use NetworkList for the remaining
get_all and get_all_by_uuids queries.

Related to blueprint nova-network-objects

Change-Id: Ic3e53bb4dc7b6930ceed14e214bbf66d0cc09f53
Make nova-network use Network object for remaining "get" queries

This makes nova-network manager use the Network object for the
remaining single-item "get" queries.

Related to blueprint nova-network-objects

Change-Id: I6b1764e3c95337982cf4fbf503ddcb755e33cf2b
Make nova-network use Network object for updates

This makes nova-network manager use the Network object (which is
already present in most places) for update operations, in the form
of save().

Related to blueprint nova-network-objects

Change-Id: Icd1a41f1da67d08ecccf8ef9ebc5b9d1e7b28eab
Make nova-network use Network object for set_host() operation

This makes nova-network manager use the Network object instead
of the direct-to-database call.

Related to blueprint nova-network-objects

Change-Id: I109aa8fe3589100cf32a40ce90f7b28ca2e5440a
Make nova-network use Network for associations

This makes nova-network use the Network object for associate
and disassociate operations instead of direct database calls.

Related to blueprint nova-network-objects

Change-Id: Ia1615a83af102a527d82c4b22e1dcec2e9364c28
Make nova-network use Network object for deleting networks

This makes nova-network manager use the Network object when
deleting networks. Since it results in the same underlying call
to the database, it doesn't affect tests at all.

Related to blueprint nova-network-objects

Change-Id: If45020b8264f05b12657bb27f836b9fc60964cd1
Refactor return value of fixed_ip_associate calls

This makes the fixed_ip_associate* calls more object-friendly.
Rather few things outside of the tests care about the return value of
these methods, so this is less invasive than it looks. All of the
tests and manager methods that this touches will be replaced
as part of the objectification going forward, so this is only
transitional.

Related to blueprint nova-network-objects

Change-Id: I4764fa0bfca355377d2642ddf3fbfe17cf5b761e
Make fixed_ip_get_by_address() take columns_to_join

This will let the FixedIP object make some significantly more
efficient queries by asking for network and/or instance at the
same times as the FixedIP itself.

Related to nova-network-objects

Change-Id: I7ae971469585f072cd039f30faf71a4d48c9fd04
Merge "Use utils method when getting instance metadata and system metadata"
Merge "xenapi: clean up step decorator fake steps"
Merge "libvirt: Review of the code to use module units"
Merge "Make nova-network a "conductor-using service""
Merge "Make nova-network use Network object for get-all-by-host query"
Merge "Make nova-network use NetworkList for remaining "all" queries"
Merge "Make nova-network use Network object for remaining "get" queries"