Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions openstack/ims/v2/cloudimages/results_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ type JobStatus struct {
}

type JobEntity struct {
ImageID string `json:"image_id"`
ImageID string `json:"image_id"`
DataImageID string `json:"__data_images"`
}

type JobResult struct {
Expand Down Expand Up @@ -65,7 +66,7 @@ func WaitForJobSuccess(client *golangsdk.ServiceClient, secs int, jobID string)
}

func GetJobEntity(client *golangsdk.ServiceClient, jobId string, label string) (interface{}, error) {
if label != "image_id" {
if label != "image_id" && label != "__data_images" {
return nil, fmt.Errorf("Unsupported label %s in GetJobEntity.", label)
}

Expand All @@ -82,6 +83,9 @@ func GetJobEntity(client *golangsdk.ServiceClient, jobId string, label string) (
if e := job.Entities.ImageID; e != "" {
return e, nil
}
if e := job.Entities.DataImageID; e != "" {
return e, nil
}
}

return nil, fmt.Errorf("Unexpected conversion error in GetJobEntity.")
Expand Down