[hopem,r=]

Support multiple l3 segments.
Closes-Bug: 1523871
This commit is contained in:
Edward Hope-Morley
2016-02-10 15:21:47 +00:00
parent 960ae19acf
commit 408b1c7a4e
3 changed files with 28 additions and 12 deletions

View File

@@ -23,8 +23,8 @@ from charmhelpers.core.host import (
lsb_release
)
from charmhelpers.contrib.network import ip
from charmhelpers.contrib.network.ip import (
get_address_in_network,
get_ipv6_addr
)
@@ -87,10 +87,13 @@ def get_host_ip(hostname=None):
return answers[0].address
@cached
def get_public_addr():
return ip.get_address_in_network(config('ceph-public-network'),
fallback=get_host_ip())
def get_networks(config_opt='ceph-public-network'):
networks = config(config_opt)
if networks:
networks = networks.split()
return [n for n in networks if get_address_in_network(n)]
return []
def assert_charm_supports_ipv6():