Fix input validation for V2 API server group API extension

The server group extension create method allows the name
parameter to not be a string. The unittest which tests that an integer
passed as the name fails, but this is due to the policies parameter
missing from the test data, not because the name is invalid.

The internal nova code silently converts floats, integers, etc to strings
and so also does not pick up the validation issue.

The patch adds extra input validation to the API layer to pick up this issue
and also tightens the acceptable values of the string to reject trailing
or leading whitespace which if used can cause confusion for users. It uses
the regexp that the other parts of the API are converging towards to use
as a common acceptable name across the API rather than having different
criteria for names for different extensions.

Also ensures input validation is always properly applied to the policies
parameter and adds test cases. This part is backported from this
https://review.openstack.org/#/c/79312/5 patch.

The patch also fixes the broken unittests and adds new ones to test the
tightened criteria for the name parameter.

+DocImpact
Co-authored-by: Gary Kotton <gkotton@vmware.com>
Closes-Bug: 1290326

Change-Id: I9ddaef8a128ac6a1a448e47d6b3c9abcf719eb76
Merge "Fix input validation for V2 API server group API extension"