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
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 "instance_info_cache_update creates wrongly"
Merge "validate security_groups on server create"