Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 9e3d9db

Browse files
James FisherSamuel Ortiz
authored andcommitted
extract Properties
1 parent 970e97f commit 9e3d9db

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

openstack/imageservice/v2/requests_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func TestCreateImage(t *testing.T) {
4242
Visibility: ImageVisibilityPrivate,
4343

4444
Metadata: make(map[string]string),
45+
Properties: make(map[string]string),
4546
}
4647

4748
th.AssertDeepEquals(t, &expectedImage, actualImage)
@@ -82,6 +83,7 @@ func TestGetImage(t *testing.T) {
8283
SizeBytes: &sizebytes,
8384

8485
Metadata: make(map[string]string),
86+
Properties: make(map[string]string),
8587
}
8688

8789
th.AssertDeepEquals(t, &expectedImage, actualImage)

openstack/imageservice/v2/results.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,10 @@ func extractImage(res gophercloud.ErrResult) (*Image, error) {
292292
if image.Metadata, err = extractMapStringStringAtKeyOptional(body, "metadata", make(map[string]string)); err != nil {
293293
return nil, err
294294
}
295-
296-
// TODO Metadata map[string]string `mapstructure:"metadata"`
297-
// TODO Properties map[string]string `mapstructure:"properties"`
295+
296+
if image.Properties, err = extractMapStringStringAtKeyOptional(body, "properies", make(map[string]string)); err != nil {
297+
return nil, err
298+
}
298299

299300
return &image, nil
300301
}

0 commit comments

Comments
 (0)