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
=== modified file 'state/state.go'
--- state/state.go 2012-05-29 23:11:41 +0000
+++ state/state.go 2012-05-31 07:26:18 +0000
@@ -74,6 +74,11 @@
74 return newConfigWatcher(s, zkEnvironmentPath)74 return newConfigWatcher(s, zkEnvironmentPath)
77// Environment returns the current configuration of the environment.
78func (s *State) Environment() (*ConfigNode, error) {
79 return readConfigNode(s.zk, zkEnvironmentPath)
77// Machine returns the machine with the given id.82// Machine returns the machine with the given id.
78func (s *State) Machine(id int) (*Machine, error) {83func (s *State) Machine(id int) (*Machine, error) {
79 key := machineKey(id)84 key := machineKey(id)


People subscribed via source and target branches

to all changes: