Add ha options and fix get_dns_hosts
This commit is contained in:
parent
84ba5044b1
commit
4e271798f7
12
config.yaml
12
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.
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user