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

Issue 6488077: juju: always connect to State.

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

Description

juju: always connect to State. All uses of juju.Conn other than Bootstrap and Destroy require a state connection, so make State an exported field of Conn and connect to it when creating the Conn. The few places that call Bootstrap can easily call Environ.Bootstrap instead. Also add environs.NewFromName to make it easier to open an environment, rename juju.NewConn to juju.NewConnFromName, and add juju.NewConnFromEnviron to join the dots. https://code.launchpad.net/~rogpeppe/juju-core/048-juju-conn-state-always/+merge/122529 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : juju: always connect to State. #

Total comments: 7

Patch Set 3 : juju: always connect to State. #

Patch Set 4 : juju: always connect to State. #

Patch Set 5 : juju: always connect to State. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -210 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/addunit.go View 1 2 3 4 1 chunk +2 lines, -6 lines 0 comments Download
M cmd/juju/bootstrap.go View 2 chunks +3 lines, -3 lines 0 comments Download
M cmd/juju/deploy.go View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/destroy.go View 2 chunks +3 lines, -3 lines 0 comments Download
M cmd/juju/expose.go View 1 2 3 4 1 chunk +2 lines, -6 lines 0 comments Download
M cmd/juju/status.go View 1 2 3 4 2 chunks +7 lines, -12 lines 0 comments Download
M cmd/juju/unexpose.go View 1 2 3 4 1 chunk +2 lines, -6 lines 0 comments Download
M environs/jujutest/livetests.go View 1 2 3 4 1 chunk +6 lines, -12 lines 0 comments Download
M environs/open.go View 1 chunk +11 lines, -0 lines 0 comments Download
M juju/conn.go View 1 2 3 4 2 chunks +37 lines, -77 lines 0 comments Download
M juju/conn_test.go View 1 2 3 4 3 chunks +27 lines, -44 lines 0 comments Download
M juju/deploy.go View 1 2 6 chunks +6 lines, -18 lines 0 comments Download
M juju/deploy_test.go View 1 2 3 4 9 chunks +15 lines, -17 lines 0 comments Download
M juju/testing/conn.go View 1 2 3 4 1 chunk +7 lines, -5 lines 0 comments Download

Messages

Total messages: 10
rog
Please take a look.
11 years, 8 months ago (2012-09-03 14:15:48 UTC) #1
rog
Please take a look.
11 years, 8 months ago (2012-09-03 14:19:03 UTC) #2
TheMue
LGTM, only one question. https://codereview.appspot.com/6488077/diff/3001/juju/deploy.go File juju/deploy.go (right): https://codereview.appspot.com/6488077/diff/3001/juju/deploy.go#newcode19 juju/deploy.go:19: name = ch.URL().Name // TODO ...
11 years, 8 months ago (2012-09-03 14:27:49 UTC) #3
rog
https://codereview.appspot.com/6488077/diff/3001/juju/deploy.go File juju/deploy.go (right): https://codereview.appspot.com/6488077/diff/3001/juju/deploy.go#newcode19 juju/deploy.go:19: name = ch.URL().Name // TODO sch.Meta().Name ? On 2012/09/03 ...
11 years, 8 months ago (2012-09-03 14:30:26 UTC) #4
niemeyer
Looks fine, although I'd prefer to see NewConn going away. LGTM https://codereview.appspot.com/6488077/diff/3001/juju/conn.go File juju/conn.go (right): ...
11 years, 8 months ago (2012-09-03 16:04:51 UTC) #5
rog
Please take a look. https://codereview.appspot.com/6488077/diff/3001/juju/conn.go File juju/conn.go (right): https://codereview.appspot.com/6488077/diff/3001/juju/conn.go#newcode51 juju/conn.go:51: func NewConn(environName string) (*Conn, error) ...
11 years, 8 months ago (2012-09-03 16:23:06 UTC) #6
rog
Please take a look.
11 years, 8 months ago (2012-09-03 16:30:26 UTC) #7
niemeyer
https://codereview.appspot.com/6488077/diff/3001/juju/conn.go File juju/conn.go (right): https://codereview.appspot.com/6488077/diff/3001/juju/conn.go#newcode51 juju/conn.go:51: func NewConn(environName string) (*Conn, error) { On 2012/09/03 16:23:06, ...
11 years, 8 months ago (2012-09-03 17:24:17 UTC) #8
niemeyer
LGTM with these.
11 years, 8 months ago (2012-09-03 17:31:48 UTC) #9
rog
11 years, 8 months ago (2012-09-03 17:37:57 UTC) #10
*** Submitted:

juju: always connect to State.

All uses of juju.Conn other than Bootstrap and Destroy require a state
connection, so make State an exported field of Conn and connect to it
when creating the Conn.

The few places that call Bootstrap can easily call Environ.Bootstrap
instead.

Also add environs.NewFromName to make it easier to open an
environment, rename juju.NewConn to juju.NewConnFromName, and add
juju.NewConnFromEnviron to join the dots.

R=TheMue, niemeyer
CC=
https://codereview.appspot.com/6488077
Sign in to reply to this message.

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