Merge lp:~dave-cheney/pyjuju/go-state-add-environment into lp:pyjuju/go

Proposed by Dave Cheney
Status: Merged
Approved by: Gustavo Niemeyer
Approved revision: 191
Merged at revision: 199
Proposed branch: lp:~dave-cheney/pyjuju/go-state-add-environment
Merge into: lp:pyjuju/go
Diff against target: 15 lines (+5/-0)
1 file modified
state/state.go (+5/-0)
To merge this branch: bzr merge lp:~dave-cheney/pyjuju/go-state-add-environment
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email:

Description of the change

state: add state.Environment

This func provides direct access to the current environment
configuration as a *ConfigNode. This is used buy jujut and
is needed for testing the provisioning agent as
state.readConfigNode() is not exported.

To post a comment you must log in.
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

LGTM, but can you please add a trivial test before submitting?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'state/state.go'
2--- state/state.go 2012-05-29 23:11:41 +0000
3+++ state/state.go 2012-05-31 07:26:18 +0000
4@@ -74,6 +74,11 @@
5 return newConfigWatcher(s, zkEnvironmentPath)
6 }
8+// Environment returns the current configuration of the environment.
9+func (s *State) Environment() (*ConfigNode, error) {
10+ return readConfigNode(s.zk, zkEnvironmentPath)
13 // Machine returns the machine with the given id.
14 func (s *State) Machine(id int) (*Machine, error) {
15 key := machineKey(id)


People subscribed via source and target branches

to all changes: