Merge lp://staging/~julian-edwards/gwacl/updatehostedservice into lp://staging/gwacl

Proposed by Julian Edwards
Status: Merged
Approved by: Julian Edwards
Approved revision: 162
Merged at revision: 161
Proposed branch: lp://staging/~julian-edwards/gwacl/updatehostedservice
Merge into: lp://staging/gwacl
Diff against target: 197 lines (+130/-3)
4 files modified
management_base.go (+21/-3)
management_base_test.go (+30/-0)
xmlobjects.go (+24/-0)
xmlobjects_test.go (+55/-0)
To merge this branch: bzr merge lp://staging/~julian-edwards/gwacl/updatehostedservice
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+172957@code.staging.launchpad.net

Commit message

Add UpdateHostedService api call.

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Thanks, nice change.

[0]

+func (api *ManagementAPI) UpdateHostedService(serviceName string, params *UpdateHostedService) error {
11 + var err error
12 + URI := "services/hostedservices/" + serviceName

You forgot to call checkPathComponents(serviceName)

[1]

11 + var err error

No need for this declaration I think.

[2]

This can be done later but it would be great to use this method in example/management/run.go.

[3]

[2]

152 +func (suite *xmlSuite) TestUpdateHostedService(c *C) {
153 + label := MakeRandomString(10)
154 + expected := makeUpdateHostedService(label)
155 + input := UpdateHostedService{
156 + XMLNS: XMLNS,
157 + Label: label,
158 + Description: "description",

This is a detail but it's a bit weird that "description" references a string that is buried deep in the XML code above, maybe the description (and the other values of the XML string) should be an argument of makeUpdateHostedService().

review: Approve
Revision history for this message
Julian Edwards (julian-edwards) wrote :

On 04/07/13 16:55, Raphaël Badin wrote:
> Review: Approve
>
> Thanks, nice change.

Thank you.

>
> [0]
>
> +func (api *ManagementAPI) UpdateHostedService(serviceName string, params *UpdateHostedService) error {
> 11 + var err error
> 12 + URI := "services/hostedservices/" + serviceName
>
> You forgot to call checkPathComponents(serviceName)

Ok thanks.

>
> [1]
>
> 11 + var err error
>
> No need for this declaration I think.

Well - it kinda is. When you do multiple assignments to err, if it's
the second return value in a := statement it doesn't get set
consistently in my experience - at least it's fucking confusing me
anyway, assignment semantics in Go are batshit. Adding the var ensures
it's never masking the result with subsequent assignments.

>
> [2]
>
> This can be done later but it would be great to use this method in example/management/run.go.

Indeed, but the branch was large enough.

>
> [3]
>
> [2]
>
> 152 +func (suite *xmlSuite) TestUpdateHostedService(c *C) {
> 153 + label := MakeRandomString(10)
> 154 + expected := makeUpdateHostedService(label)
> 155 + input := UpdateHostedService{
> 156 + XMLNS: XMLNS,
> 157 + Label: label,
> 158 + Description: "description",
>
>
> This is a detail but it's a bit weird that "description" references a string that is buried deep in the XML code above, maybe the description (and the other values of the XML string) should be an argument of makeUpdateHostedService().
>

True, and I was just harping on about that in IRC as well :) I fixed
it, thanks for point it out.

J

162. By Julian Edwards

improvements after the review

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: