Merge lp://staging/~natefinch/juju-core/039-saveapiaddresses into lp://staging/~go-bot/juju-core/trunk
Proposed by
Nate Finch
Status: | Work in progress |
---|---|
Proposed branch: | lp://staging/~natefinch/juju-core/039-saveapiaddresses |
Merge into: | lp://staging/~go-bot/juju-core/trunk |
Diff against target: |
34 lines (+10/-0) 1 file modified
cmd/jujud/machine.go (+10/-0) |
To merge this branch: | bzr merge lp://staging/~natefinch/juju-core/039-saveapiaddresses |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+213530@code.staging.launchpad.net |
Description of the change
save apiaddresses to agent config
To post a comment you must log in.
Unmerged revisions
- 2523. By Nate Finch
-
change to get the correct addresses
- 2522. By Nate Finch
-
too many returns
- 2521. By Nate Finch
-
save api addresses
Reviewers: mp+213530_ code.launchpad. net,
Message:
Please take a look.
Description:
save apiaddresses to agent config
https:/ /code.launchpad .net/~natefinch /juju-core/ 039-saveapiaddr esses/+ merge/213530
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/82780043/
Affected files (+20, -0 lines): machine. go
A [revision details]
M agent/agent.go
M cmd/jujud/
Index: [revision details] 20140331151115- oc6nja5tv9g8z7l 1
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: agent/agent.go MigrateParams) error (addrs []string)
=== modified file 'agent/agent.go'
--- agent/agent.go 2014-03-31 06:30:43 +0000
+++ agent/agent.go 2014-03-31 18:13:17 +0000
@@ -152,6 +152,9 @@
// (if DataDir is set), the the caller is responsible for removing
// the old configuration.
Migrate(
+
+ // SetAPIAddresses sets the addresses that the agent will try to connect
to.
+ SetAPIAddresses
}
type ConfigWriter interface { .addresses = addrs
@@ -441,6 +444,10 @@
c.apiDetails
}
+func (c *configInternal) SetAPIAddresses (addrs []string) { addresses = addrs c.values, key)
+ c.apiDetails.
+}
+
func (c *configInternal) SetValue(key, value string) {
if value == "" {
delete(
Index: cmd/jujud/ machine. go machine. go' machine. go 2014-03-28 10:11:59 +0000 machine. go 2014-03-31 18:14:18 +0000 FromMachines( ) func(c agent.ConfigSetter) { es(addrs) }) a.stateOpened) State(st)
=== modified file 'cmd/jujud/
--- cmd/jujud/
+++ cmd/jujud/
@@ -334,6 +334,16 @@
return nil, err
}
a.st = st
+
+ addrs, err := st.APIAddresses
+ if err != nil {
+ return nil, fmt.Errorf("Error getting API addresses from state: %v", err)
+ }
+ err = a.ChangeConfig(
c.SetAPIAddress
+ if err != nil {
+ return nil, fmt.Errorf("Error saving API addresses to agent config: %v",
err)
+ }
+
close(
reportOpened
@@ -403,6 +413,7 @@ agentConfig. Tag()) IsNotFoundError (err) {
st.Close()
}
}()
+
m0, err := st.FindEntity(
if err != nil {
if errors.