Merge lp:~natefinch/juju-core/051-agent-addresses into lp:~go-bot/juju-core/trunk
Proposed by
Nate Finch
Status: | Work in progress |
---|---|
Proposed branch: | lp:~natefinch/juju-core/051-agent-addresses |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
42 lines (+6/-10) 2 files modified
agent/agent.go (+4/-3) agent/agent_test.go (+2/-7) |
To merge this branch: | bzr merge lp:~natefinch/juju-core/051-agent-addresses |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+218878@code.launchpad.net |
Description of the change
API should report all non-machine-local addresses
To support the manual provider, we need to report all addresses that are not machine-local for the API servers. Previously, we were only reporting cloud-local addresses, which often will not work if you're using the manual provider.
To post a comment you must log in.
Unmerged revisions
- 2705. By Nate Finch
-
report all addresses that aren't machine-local for API addresses
Reviewers: mp+218878_ code.launchpad. net,
Message:
Please take a look.
Description:
API should report all non-machine-local addresses
To support the manual provider, we need to report all addresses that are
not machine-local for the API servers. Previously, we were only
reporting cloud-local addresses, which often will not work if you're
using the manual provider.
https:/ /code.launchpad .net/~natefinch /juju-core/ 051-agent- addresses/ +merge/ 218878
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/91270044/
Affected files (+8, -10 lines):
A [revision details]
M agent/agent.go
M agent/agent_test.go
Index: [revision details] 20140507125024- 3qwgzgd4kzdr6pr t
=== 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 SelectInternalH ostPort( serverHostPorts , false) NetworkMachineL ocal { .addresses = addrs
=== modified file 'agent/agent.go'
--- agent/agent.go 2014-04-23 08:50:28 +0000
+++ agent/agent.go 2014-05-08 20:12:21 +0000
@@ -440,9 +440,10 @@
}
var addrs []string
for _, serverHostPorts := range servers {
- addr := instance.
- if addr != "" {
- addrs = append(addrs, addr)
+ for _, hp := range serverHostPorts {
+ if hp.NetworkScope != instance.
+ addrs = append(addrs, hp.NetAddr())
+ }
}
}
c.apiDetails
Index: agent/agent_test.go agent_test. go' .APIAddresses)
=== modified file 'agent/
--- agent/agent_test.go 2014-04-23 08:50:28 +0000
+++ agent/agent_test.go 2014-05-08 20:12:21 +0000
@@ -508,12 +508,7 @@
c.Assert(err, gc.IsNil)
c.Assert(addrs, gc.DeepEquals, attributeParams
- // The first cloud-local address for each server is used, NewAddresses( "0.1.2. 3", "0.1.2.4", "zeroonetwothree") 0].NetworkScope = instance. NetworkCloudLoc al 1].NetworkScope = instance. NetworkCloudLoc al "0.1.2. 3:123", "0.1.2.5:125"}) "0.1.2. 3:123", "0.1.2.5:125", "0.1.2.4:123", "zeroonetwothre e:123", "zeroonetwofive :125"})
- // else if there are none then the first public- or unknown-
- // scope address.
- //
- // If a server has only machine-local addresses, or none
- // at all, then it will be excluded.
+ // All addresses which are not machine-local will be used.
server1 := instance.
server1[
server1[
@@ -530,5 +525,5 @@
})
addrs, err = conf.APIAddresses()
c.Assert(err, gc.IsNil)
- c.Assert(addrs, gc.DeepEquals, []string{
+ c.Assert(addrs, jc.SameContents,
[]string{
}