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

Issue 6782112: Initial glance client (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by wallyworld
Modified:
11 years, 4 months ago
Reviewers:
mp+136081, rog
Visibility:
Public.

Description

Initial glance client This branch implements an initial glance client. Only a few basic APIs are implemented since I'm not sure exactly what we'll need to provide. New APIs can easily be added as required. I've also renamed a few interfaces. https://code.launchpad.net/~wallyworld/goose/initial-glance-module/+merge/136081 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 25

Patch Set 2 : Initial glance client #

Total comments: 9

Patch Set 3 : Initial glance client #

Total comments: 45

Patch Set 4 : Initial glance client #

Patch Set 5 : Initial glance client #

Total comments: 6

Patch Set 6 : Initial glance client #

Unified diffs Side-by-side diffs Delta from patch set Stats (+316 lines, -206 lines) Patch
A [revision details] View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M client/client.go View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M client/client_test.go View 1 2 3 4 5 2 chunks +4 lines, -13 lines 0 comments Download
A glance/glance.go View 1 2 3 1 chunk +93 lines, -0 lines 0 comments Download
A glance/glance_test.go View 1 2 3 1 chunk +80 lines, -0 lines 0 comments Download
M identity/identity.go View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M nova/nova.go View 1 2 3 4 16 chunks +79 lines, -121 lines 0 comments Download
M nova/nova_test.go View 1 2 3 3 chunks +6 lines, -16 lines 0 comments Download
M swift/swift.go View 1 2 3 3 chunks +31 lines, -40 lines 0 comments Download
M swift/swift_test.go View 1 2 3 3 chunks +6 lines, -16 lines 0 comments Download

Messages

Total messages: 19
jameinel
LGTM overall, some small tweaks. https://codereview.appspot.com/6782112/diff/1/[revision%20details] File [revision details] (right): https://codereview.appspot.com/6782112/diff/1/[revision%20details]#newcode2 [revision details]:2: New revision: ...
11 years, 5 months ago (2012-11-26 13:07:56 UTC) #1
rog
looks reasonable, except i am concerned about the replication of very similar APIs with small ...
11 years, 5 months ago (2012-11-26 14:32:37 UTC) #2
gz
So, juju doesn't actually require any of the glance apis, but adding it to goose ...
11 years, 5 months ago (2012-11-26 17:30:21 UTC) #3
wallyworld
https://codereview.appspot.com/6782112/diff/1/glance/glance.go File glance/glance.go (right): https://codereview.appspot.com/6782112/diff/1/glance/glance.go#newcode15 glance/glance.go:15: // Provide access to the OpenStack Glance service. On ...
11 years, 5 months ago (2012-11-26 23:04:45 UTC) #4
wallyworld
Please take a look.
11 years, 5 months ago (2012-11-27 11:31:01 UTC) #5
rog
On 26 November 2012 23:04, <ian.booth@canonical.com> wrote: > Reviewers: mp+136081_code.launchpad.net, john.meinel, rog, gz, > > ...
11 years, 5 months ago (2012-11-27 13:09:03 UTC) #6
rog
https://codereview.appspot.com/6782112/diff/1009/glance/glance.go File glance/glance.go (right): https://codereview.appspot.com/6782112/diff/1009/glance/glance.go#newcode24 glance/glance.go:24: type GlanceClient struct { i might have said it ...
11 years, 5 months ago (2012-11-27 14:56:29 UTC) #7
wallyworld
On 2012/11/27 13:09:03, rog wrote: > On 26 November 2012 23:04, <mailto:ian.booth@canonical.com> wrote: > > ...
11 years, 5 months ago (2012-11-28 01:12:41 UTC) #8
wallyworld
Please take a look. https://codereview.appspot.com/6782112/diff/1009/glance/glance.go File glance/glance.go (right): https://codereview.appspot.com/6782112/diff/1009/glance/glance.go#newcode24 glance/glance.go:24: type GlanceClient struct { On ...
11 years, 5 months ago (2012-11-28 01:14:19 UTC) #9
dave_cheney.net
Thanks Ian. Coming along nicely. https://codereview.appspot.com/6782112/diff/8002/glance/glance.go File glance/glance.go (right): https://codereview.appspot.com/6782112/diff/8002/glance/glance.go#newcode16 glance/glance.go:16: type Glance interface { ...
11 years, 5 months ago (2012-11-28 01:32:51 UTC) #10
rog
>> Usually it's not the Go way, because when you test some logic, you >> ...
11 years, 5 months ago (2012-11-28 09:38:20 UTC) #11
wallyworld
On 2012/11/28 09:38:20, rog wrote: > >> Usually it's not the Go way, because when ...
11 years, 5 months ago (2012-11-28 09:54:52 UTC) #12
rog
On 2012/11/28 09:54:52, wallyworld wrote: > On 2012/11/28 09:38:20, rog wrote: > > >> Usually ...
11 years, 5 months ago (2012-11-28 11:48:16 UTC) #13
dimitern
LGTM, overall, with some minor comments - while I agree with some of the other ...
11 years, 5 months ago (2012-11-28 15:46:27 UTC) #14
wallyworld
Please take a look. https://codereview.appspot.com/6782112/diff/8002/glance/glance.go File glance/glance.go (right): https://codereview.appspot.com/6782112/diff/8002/glance/glance.go#newcode16 glance/glance.go:16: type Glance interface { On ...
11 years, 5 months ago (2012-11-29 02:34:37 UTC) #15
wallyworld
Please take a look.
11 years, 5 months ago (2012-11-29 02:44:35 UTC) #16
jameinel
LGTM I'd like to see at least a smoke test for CompleteCredentialsFromEnv (we have the ...
11 years, 5 months ago (2012-11-29 06:10:00 UTC) #17
wallyworld
*** Submitted: Initial glance client This branch implements an initial glance client. Only a few ...
11 years, 5 months ago (2012-11-29 06:44:03 UTC) #18
rog
11 years, 5 months ago (2012-11-29 09:18:28 UTC) #19
https://codereview.appspot.com/6782112/diff/3017/nova/nova.go
File nova/nova.go (left):

https://codereview.appspot.com/6782112/diff/3017/nova/nova.go#oldcode90
nova/nova.go:90: 
On 2012/11/29 06:10:00, jameinel wrote:
> I don't really understand why Roger doesn't like named return variables. I
> personally think they are really nice. I like named parameters and return
> variables because it tends to be helpful for readers of the function.
> 
> Roger, can you comment on why you recommended removing them all? I'm assuming
> that the changes in this file are all just the mechanical "get rid of named
> return values and make them explicit".
> 
> Maybe he is objecting to mixing the two styles? (naming the return values but
> explicitly returning 'return resp.Flavors, err' rather than:
>  flavors = resp.Flavors
>  return

this post probably says it better than i would:
https://plus.google.com/106356964679457436995/posts/LmnDfgehorU

in this particular case, it's not obvious that the function
always returns a nil flavors value if it returns an error.

in fact, i believe that in certain (admittedly unusual) cases it may not,
as json decoding can return an error while still filling in some of
its parameters. for example: http://play.golang.org/p/BD8mLD0hta

https://codereview.appspot.com/6782112/diff/3017/nova/nova.go
File nova/nova.go (right):

https://codereview.appspot.com/6782112/diff/3017/nova/nova.go#newcode24
nova/nova.go:24: type Client struct {
thanks.

https://codereview.appspot.com/6782112/diff/3017/nova/nova.go#newcode32
nova/nova.go:32: type Link struct {
in another CL, i'd still like to see some documentation on this type and its
fields. is Href a URL and Rel the relative part of it. what kind of things might
i expect to find in Type? as someone that might use this API at some stage, it
would be nice if i could use it without needing to read the entire openstack API
documentation.

for instance, the goamz docs have a URL in the docs for each entry point, and
that works really well.

https://codereview.appspot.com/6782112/diff/3017/nova/nova.go#newcode52
nova/nova.go:52: err := c.client.SendRequest(client.GET, "compute", apiFlavors,
&requestData, "failed to get list of flavors")
i still think this should be:

if err != nil {
    return nil, err
}
return resp.Flavors, nil

but it's fine to do it later.
Sign in to reply to this message.

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