Merge "my_ip should belong to internal-network rather than data-network"
This commit is contained in:
commit
8033d991e0
@ -630,7 +630,8 @@ class HostIPContext(context.OSContextGenerator):
|
||||
ctxt = {}
|
||||
# Use the address used in the cloud-compute relation in templates for
|
||||
# this host
|
||||
host_ip = get_relation_ip('cloud-compute')
|
||||
host_ip = get_relation_ip('cloud-compute',
|
||||
cidr_network=config('os-internal-network'))
|
||||
|
||||
if host_ip:
|
||||
# NOTE: do not format this even for ipv6 (see bug 1499656)
|
||||
|
@ -316,7 +316,8 @@ def compute_joined(rid=None):
|
||||
# add the hostname configured locally to the relation.
|
||||
settings = {
|
||||
'hostname': gethostname(),
|
||||
'private-address': get_relation_ip('cloud-compute'),
|
||||
'private-address': get_relation_ip(
|
||||
'cloud-compute', cidr_network=config('os-internal-network')),
|
||||
}
|
||||
|
||||
if migration_enabled():
|
||||
|
@ -443,7 +443,8 @@ class NovaComputeContextTests(CharmTestCase):
|
||||
self.get_relation_ip.return_value = '172.24.0.79'
|
||||
host_ip = context.HostIPContext()
|
||||
self.assertEqual({'host_ip': '172.24.0.79'}, host_ip())
|
||||
self.get_relation_ip.assert_called_with('cloud-compute')
|
||||
self.get_relation_ip.assert_called_with('cloud-compute',
|
||||
cidr_network=None)
|
||||
|
||||
@patch('subprocess.call')
|
||||
def test_host_IP_context_ipv6(self, _call):
|
||||
|
Loading…
x
Reference in New Issue
Block a user