diff --git a/config.yaml b/config.yaml index 84ad40f1..148466a5 100644 --- a/config.yaml +++ b/config.yaml @@ -127,3 +127,15 @@ options: default: False dns_hosts: type: string + ha-bindiface: + type: string + default: eth0 + description: | + Default network interface on which HA cluster will bind to communicate + with the other members of the HA Cluster. + ha-mcastport: + type: int + default: 5409 + description: | + Default multicast port number that will be used to communicate between + HA Cluster nodes. diff --git a/hooks/quantum_utils.py b/hooks/quantum_utils.py index d48da4e7..78dadf5b 100644 --- a/hooks/quantum_utils.py +++ b/hooks/quantum_utils.py @@ -590,10 +590,13 @@ def configure_ovs(): def get_dns_host(): dns_hosts = ['8.8.8.8 '] try: - nameservers = subprocess.check_output(['grep', 'nameserver', - '/etc/resolv.conf']) - for ns in nameservers: - dns_hosts.append(ns.split(' ')[1].split('\n')[0].strip() + ' ') + output = subprocess.check_output(['grep', 'nameserver', + '/etc/resolv.conf']) + nameservers = output.split('\n') + hosts = [(ns.split(' ')[1].split('\n')[0].strip() + ' ') + for ns in nameservers if ns.startswith('nameserver') + and ns.split(' ')[1]] + dns_hosts.append(hosts) except Exception: log('Failed to get nameserver from resolv.conf !', level=ERROR)