diff options
author | Sean Dague <sdague@linux.vnet.ibm.com> | 2013-02-28 15:32:33 -0500 |
---|---|---|
committer | Sean Dague <sdague@linux.vnet.ibm.com> | 2013-03-01 17:50:07 -0500 |
commit | 1c6cc18b0cef25bfff8566c2a646cd8bcbbe132a (patch) | |
tree | 3ebcde4c28a641ea182dc6d518ad73b345a06929 /nova/utils.py | |
parent | a94176e15bcaf9a557c4cf16bd83b6aedb6db07d (diff) | |
download | nova-1c6cc18b0cef25bfff8566c2a646cd8bcbbe132a.tar.gz nova-1c6cc18b0cef25bfff8566c2a646cd8bcbbe132a.tar.xz nova-1c6cc18b0cef25bfff8566c2a646cd8bcbbe132a.zip |
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
Diffstat (limited to 'nova/utils.py')
0 files changed, 0 insertions, 0 deletions