Server Metadata Update (#93)
This commit updates the Server Metadata so it can be parsed and
translated using JSON tags.
The Server Metadata result has been changed to map[string]string to
match the request.
A unit test was added to verify the above and a piece of metadata has
been added to the server creation acceptance test.
diff --git a/openstack/compute/v2/servers/testing/requests_test.go b/openstack/compute/v2/servers/testing/requests_test.go
index b651b92..418a730 100644
--- a/openstack/compute/v2/servers/testing/requests_test.go
+++ b/openstack/compute/v2/servers/testing/requests_test.go
@@ -89,6 +89,24 @@
th.CheckDeepEquals(t, ServerDerp, *actual)
}
+func TestCreateServerWithMetadata(t *testing.T) {
+ th.SetupHTTP()
+ defer th.TeardownHTTP()
+ HandleServerCreationWithMetadata(t, SingleServerBody)
+
+ actual, err := servers.Create(client.ServiceClient(), servers.CreateOpts{
+ Name: "derp",
+ ImageRef: "f90f6034-2570-4974-8351-6b49732ef2eb",
+ FlavorRef: "1",
+ Metadata: map[string]string{
+ "abc": "def",
+ },
+ }).Extract()
+ th.AssertNoErr(t, err)
+
+ th.CheckDeepEquals(t, ServerDerp, *actual)
+}
+
func TestCreateServerWithImageNameAndFlavorName(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()