Remove unused nova.db.api:instance_get_all_by_reservation

Change-Id: I55192773eaa18eb81ffb2b5ec3567b09116b0d1e
Make allocate_for_instance() return only info about ports allocated

Previously, the compute manager was filtering the results based on the
port id that the user requested. However, if they do not pass one (which
is valid) then we can not do the filter and we fail. This makes the
allocation function do the filtering, which should not affect the normal
use case where it is only called once, since all the ports returned were
allocated at that time.

The manager filter behavior is thus removed and a test is added to
verify that the allocate method does the right thing the second time
around.

This fixes the fallout found after fixing the actual cause of bug 1131264

Change-Id: I8f3af96051268503596007491af365e8ce28f5b3
Improve output msgs for _compare_result

In case of errors, the messages are now more detailed.
Fixes bug 1133621

Change-Id: I7747d7c4dcaf2199dc55139ee0235f6adca1ad36
instance_info_cache_update creates wrongly

If instance_info_cache_update() finds that the entry doesn't exist, it
attempts to create an entry, but it didn't use all of the data. This
patch fixes that.

Also if the info_cache entry was found to be deleted, the old code would
attempt to create a new entry.  This would have failed with
DBDuplicateEntry..  Instead, raise InstanceInfoCacheNotFound, which is
more appropriate. (It doesn't seem we actually ever hit this case.)

Fixes bug 1131594

Change-Id: Id008faf5c4a48ab6a04e75796b7e61dea102acc9
Sync timeutils and memorycache from oslo.

Change-Id: Ifd57eac428c28e527a62cfa46f43c710ba5f46e6
validate security_groups on server create

security_groups were getting passed all the way into the database
without ever checking for their existance. This allowed for crudding
up the db with bad data, as well as succeeding when an admin typoed
a security group, and getting no active security group.

Also, security_group is actually an array, which is not implied by
it being a singular variable. Make it a plural variable to cause
less confusion in the future.

And given that we multiply change security_groups from None =>
['default'], get rid of a utility function that serves no purpose
to handle the None or string cases.

To test this correctly, stub out the db call, so we manage to get
all the way down to the bottom of the stack sanely. Also ensure that
the negative case gets us the expected HTTPBadRequest.

Partial fix for nova bugs needed to reenable test_servers_negative
in Tempest. Fixes bug #1046870

Change-Id: I5b477f7bc1992abb47e014f137b8010cc76b2113
Merge "Make allocate_for_instance() return only info about ports allocated"
Merge "Remove unused nova.db.api:instance_get_all_by_reservation"
Merge "Improve output msgs for _compare_result"
Merge "Sync timeutils and memorycache from oslo."
Merge "instance_info_cache_update creates wrongly"
Merge "validate security_groups on server create"
Merge remote-tracking branch 'm_src_repo/master' into build-temp