Merge lp://staging/~dave-cheney/juju-core/071-cmd-jujud-stater-I into lp://staging/~juju/juju-core/trunk

Proposed by Dave Cheney
Status: Work in progress
Proposed branch: lp://staging/~dave-cheney/juju-core/071-cmd-jujud-stater-I
Merge into: lp://staging/~juju/juju-core/trunk
Prerequisite: lp://staging/~dave-cheney/juju-core/069-worker-stater-I
Diff against target: 203 lines (+134/-13) (has conflicts)
5 files modified
cmd/jujud/main.go (+1/-0)
cmd/jujud/stater.go (+29/-0)
cmd/jujud/stater_test.go (+87/-0)
environs/cloudinit/cloudinit.go (+16/-7)
environs/cloudinit/cloudinit_test.go (+1/-6)
Text conflict in environs/cloudinit/cloudinit.go
To merge this branch: bzr merge lp://staging/~dave-cheney/juju-core/071-cmd-jujud-stater-I
Reviewer Review Type Date Requested Status
The Go Language Gophers Pending
Review via email: mp+143638@code.staging.launchpad.net

Description of the change

cmd/jujud: introduce stater

Prereq: https://codereview.appspot.com/7134051/

This proposal introduces a new jujud subcommand, stater. The stater command replaces the current shell scripting built into cloudinit.

In future proposals the stater will become a long lived command that is responsible for the configuration of the mongodb upstart job.

https://codereview.appspot.com/7149043/

To post a comment you must log in.
Revision history for this message
William Reade (fwereade) wrote :

https://codereview.appspot.com/7149043/diff/4001/cmd/jujud/main.go
File cmd/jujud/main.go (right):

https://codereview.appspot.com/7149043/diff/4001/cmd/jujud/main.go#newcode22
cmd/jujud/main.go:22: jujud.Register(&StaterCommand{})
Either this needs a *stater.Config (-1), or the command itself needs to
set one up itself (+1); ISTM that it doesn't, and the tests poke all
that info in directly. Did I miss something?

https://codereview.appspot.com/7149043/diff/4001/cmd/jujud/stater.go
File cmd/jujud/stater.go (right):

https://codereview.appspot.com/7149043/diff/4001/cmd/jujud/stater.go#newcode12
cmd/jujud/stater.go:12: *stater.Config
Why embed a (nil) pointer when you could just embed directly...

https://codereview.appspot.com/7149043/diff/4001/cmd/jujud/stater.go#newcode22
cmd/jujud/stater.go:22: }
...initialize the fields here...

https://codereview.appspot.com/7149043/diff/4001/cmd/jujud/stater.go#newcode27
cmd/jujud/stater.go:27: sr := stater.NewStater(s.Config)
...and pass &s.Config here?

https://codereview.appspot.com/7149043/diff/4001/cmd/jujud/stater_test.go
File cmd/jujud/stater_test.go (left):

https://codereview.appspot.com/7149043/diff/4001/cmd/jujud/stater_test.go#oldcode16
cmd/jujud/stater_test.go:16: ctx := &cmd.Context{
There are a lot of these scattered through the codebase, but maybe it's
not worth factoring them into one place. Thoughts?

https://codereview.appspot.com/7149043/diff/4001/environs/cloudinit/cloudinit.go
File environs/cloudinit/cloudinit.go (left):

https://codereview.appspot.com/7149043/diff/4001/environs/cloudinit/cloudinit.go#oldcode135
environs/cloudinit/cloudinit.go:135: if err := addMongoToBoot(c, cfg);
err != nil {
I don't think this change is justified yet -- we don't pass any of the
necessary information in. (Does this actually run correctly? I don't see
how it can...)

https://codereview.appspot.com/7149043/

851. By Dave Cheney

merge from trunk and respond to review feedback

852. By Dave Cheney

 merge conflict, nothing to see here

Revision history for this message
Roger Peppe (rogpeppe) wrote :

i'm not sure that a new jujud subcommand is the way to go.
i believe the right approach is to make the state server
a job run by the machiner.

let's talk live about this.

https://codereview.appspot.com/7149043/

Unmerged revisions

852. By Dave Cheney

 merge conflict, nothing to see here

851. By Dave Cheney

merge from trunk and respond to review feedback

850. By Dave Cheney

stater tests

849. By Dave Cheney

fix tests

848. By Dave Cheney

merge from prereq

847. By Dave Cheney

remove double dd

846. By Dave Cheney

merge from prereq

845. By Dave Cheney

wip

844. By Dave Cheney

wip

843. By Dave Cheney

wip

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