Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(326)

Delta Between Two Patch Sets: glance/glance.go

Issue 6869044: Fix some error handling changes (Closed)
Left Patch Set: Created 11 years, 3 months ago
Right Patch Set: Fix some error handling changes Created 11 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « [revision details] ('k') | glance/glance_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // The glance package provides a way to access the OpenStack Image Service APIs. 1 // The glance package provides a way to access the OpenStack Image Service APIs.
2 // See http://docs.openstack.org/api/openstack-image-service/2.0/content/. 2 // See http://docs.openstack.org/api/openstack-image-service/2.0/content/.
3 package glance 3 package glance
4 4
5 import ( 5 import (
6 "fmt" 6 "fmt"
7 "launchpad.net/goose/client" 7 "launchpad.net/goose/client"
8 goosehttp "launchpad.net/goose/http" 8 goosehttp "launchpad.net/goose/http"
9 "net/http" 9 "net/http"
10 ) 10 )
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 // GetImageDetail lists details of the specified image. 89 // GetImageDetail lists details of the specified image.
90 func (c *Client) GetImageDetail(imageId string) (*ImageDetail, error) { 90 func (c *Client) GetImageDetail(imageId string) (*ImageDetail, error) {
91 var resp struct { 91 var resp struct {
92 Image ImageDetail 92 Image ImageDetail
93 } 93 }
94 url := fmt.Sprintf("%s/%s", apiImages, imageId) 94 url := fmt.Sprintf("%s/%s", apiImages, imageId)
95 requestData := goosehttp.RequestData{RespValue: &resp} 95 requestData := goosehttp.RequestData{RespValue: &resp}
96 err := c.client.SendRequest(client.GET, "compute", url, &requestData, 96 err := c.client.SendRequest(client.GET, "compute", url, &requestData,
97 "failed to get details for imageId=%s", imageId) 97 "failed to get details for imageId=%s", imageId)
98 » return &resp.Image, err 98 » if err != nil {
99 » » return nil, err
100 » }
101 » return &resp.Image, nil
99 } 102 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b