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

Issue 13212043: cmd/juju/addunit.go: use the API for juju add-unit

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 8 months ago by jameinel
Modified:
10 years, 8 months ago
Reviewers:
mp+181997, rog
Visibility:
Public.

Description

cmd/juju/addunit.go: use the API for juju add-unit This depends on both of my MPs: https://code.launchpad.net/~jameinel/juju-core/apiconn-from-name/+merge/181990 And: https://code.launchpad.net/~jameinel/juju-core/api-client-add-service-unit-to-spec-1216543/+merge/181992 But we only support 1 prereq at the moment. Anyway, the change is actually quite simple, instead of juju.NewConnFromName use juju.NewAPIConnFromName, and then use the APIConn.Client() object to actually do the requests. I've tested this integration with a 1.13.2 environment, and everything works great. I also manually inspected 1.12 to ensure that the params object already supported ToMachineSpec (it did). With --debug I can see that it really is connecting to the API and not to the MongoDB directly (it talks about connecting to wss://... rather than ...:37017). Also, it is actually *faster* to run than previously. I'm guessing it is because we don't need the Presence code to trigger a sync of all the existing nodes. When we start caching the API server addresses, this can actually become quite fast (the current slowest part is still grabbing the provider-state file and looking up the DNS name). https://code.launchpad.net/~jameinel/juju-core/cli-api-add-unit/+merge/181997 Requires: https://code.launchpad.net/~jameinel/juju-core/api-client-add-service-unit-to-spec-1216543/+merge/181992 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1

Patch Set 2 : cmd/juju/addunit.go: use the API for juju add-unit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -142 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/addunit.go View 2 chunks +5 lines, -11 lines 0 comments Download
M juju/api.go View 1 chunk +10 lines, -0 lines 0 comments Download
M juju/apiconn_test.go View 1 chunk +22 lines, -0 lines 0 comments Download
M provider/maas/instance_test.go View 1 1 chunk +3 lines, -3 lines 0 comments Download
M state/api/client.go View 1 1 chunk +4 lines, -3 lines 0 comments Download
M state/apiserver/client/client.go View 1 2 chunks +25 lines, -1 line 0 comments Download
M state/apiserver/client/client_test.go View 1 4 chunks +31 lines, -1 line 0 comments Download
M state/apiserver/client/perm_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
D state/statecmd/addunit.go View 1 1 chunk +0 lines, -32 lines 0 comments Download
D state/statecmd/addunit_test.go View 1 1 chunk +0 lines, -90 lines 0 comments Download

Messages

Total messages: 3
jameinel
Please take a look.
10 years, 8 months ago (2013-08-25 13:11:09 UTC) #1
rog
LGTM module the below. Woo! https://codereview.appspot.com/13212043/diff/1/cmd/juju/addunit.go File cmd/juju/addunit.go (left): https://codereview.appspot.com/13212043/diff/1/cmd/juju/addunit.go#oldcode102 cmd/juju/addunit.go:102: _, err = statecmd.AddServiceUnits(conn.State, ...
10 years, 8 months ago (2013-08-25 14:13:16 UTC) #2
jameinel
10 years, 8 months ago (2013-08-26 10:37:04 UTC) #3
Please take a look.
Sign in to reply to this message.

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