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

Issue 22580043: Migrate add-machine to api (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by wallyworld
Modified:
10 years, 6 months ago
Reviewers:
axw, mp+194259
Visibility:
Public.

Description

Migrate add-machine to api add-machine command is migrated to api. This command is really dual personality - it can add a machine to be provisioned by a cloud provider or it can add an exisitng machine using ssh. The first case is fully migrated. The second case has been refactored to move all the direct state/mgo connection stuff into the manual provisioning code. A more substantial refactoring is needed to fully migrate the manual provisioning case. https://code.launchpad.net/~wallyworld/juju-core/cli-api-addmachine/+merge/194259 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Migrate add-machine to api #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -30 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/addmachine.go View 3 chunks +25 lines, -20 lines 2 comments Download
M environs/manual/provisioner.go View 4 chunks +15 lines, -8 lines 0 comments Download
M environs/manual/provisioner_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M state/api/client.go View 1 1 chunk +10 lines, -0 lines 0 comments Download
M state/api/params/params.go View 1 chunk +26 lines, -0 lines 0 comments Download
M state/apiserver/client/client.go View 1 chunk +33 lines, -0 lines 2 comments Download
M state/apiserver/client/client_test.go View 2 chunks +94 lines, -0 lines 0 comments Download
M state/export_test.go View 1 chunk +2 lines, -0 lines 0 comments Download
M state/machine.go View 1 chunk +10 lines, -0 lines 0 comments Download
M state/machine_test.go View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 5
wallyworld
Please take a look.
10 years, 6 months ago (2013-11-06 23:57:14 UTC) #1
wallyworld
Please take a look.
10 years, 6 months ago (2013-11-07 00:27:45 UTC) #2
axw
LGTM, modulo below https://codereview.appspot.com/22580043/diff/20001/cmd/juju/addmachine.go File cmd/juju/addmachine.go (left): https://codereview.appspot.com/22580043/diff/20001/cmd/juju/addmachine.go#oldcode128 cmd/juju/addmachine.go:128: conf, err := conn.State.EnvironConfig() Just a ...
10 years, 6 months ago (2013-11-07 02:36:10 UTC) #3
wallyworld
https://codereview.appspot.com/22580043/diff/20001/cmd/juju/addmachine.go File cmd/juju/addmachine.go (left): https://codereview.appspot.com/22580043/diff/20001/cmd/juju/addmachine.go#oldcode128 cmd/juju/addmachine.go:128: conf, err := conn.State.EnvironConfig() On 2013/11/07 02:36:10, axw wrote: ...
10 years, 6 months ago (2013-11-07 02:42:19 UTC) #4
axw
10 years, 6 months ago (2013-11-07 03:03:32 UTC) #5
On 2013/11/07 02:42:19, wallyworld wrote:
> https://codereview.appspot.com/22580043/diff/20001/cmd/juju/addmachine.go
> File cmd/juju/addmachine.go (left):
> 
>
https://codereview.appspot.com/22580043/diff/20001/cmd/juju/addmachine.go#old...
> cmd/juju/addmachine.go:128: conf, err := conn.State.EnvironConfig()
> On 2013/11/07 02:36:10, axw wrote:
> > Just a thought, but why don't we do this on the server side? i.e. just pass
> > series="" along, and have the server deal with that.
> 
> I think that is a fair point. I'll look to do that.
> 
>
https://codereview.appspot.com/22580043/diff/20001/state/apiserver/client/cli...
> File state/apiserver/client/client.go (right):
> 
>
https://codereview.appspot.com/22580043/diff/20001/state/apiserver/client/cli...
> state/apiserver/client/client.go:472: return results, nil
> On 2013/11/07 02:36:10, axw wrote:
> > This function never fails? I would expect it to return an error if any of
the
> > AddMachines failed, and then I can go grovelling through the individual
> entries
> > to find which ones failed.
> 
> My understanding of the API is that for bulk operations, the results object
> contains a result and error for each object acted on. If the call to initiate
> the operations succeeds, nil is returned. The caller can then iterate of the
> results object to see individually whether each operation was successful or
not.

I think that makes sense when you're talking about asynchronous bulk calls, when
you have to poll the result of individual operations. *shrug* It's not a big
deal, just surprised me a little.
Sign in to reply to this message.

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