Merge "Fix the dhcp checks on centos" into stable/newton

This commit is contained in:
Jenkins 2017-10-05 22:38:22 +00:00 committed by Gerrit Code Review
commit c6ee5617f5
1 changed files with 8 additions and 3 deletions

View File

@ -45,10 +45,15 @@ def main(argv):
# now check that we only have these entries in leases file
leases = []
if not os.path.exists('/var/lib/misc/dnsmasq.leases'):
print('ERROR: dnsmasq leases file has not been generated')
sys.exit(1)
if not os.path.exists('/var/lib/dnsmasq/dnsmasq.leases'):
print('ERROR: dnsmasq leases file has not been generated')
sys.exit(1)
else:
dns_path = '/var/lib/dnsmasq/dnsmasq.leases'
else:
dns_path = '/var/lib/misc/dnsmasq.leases'
with open('/var/lib/misc/dnsmasq.leases') as csvfile:
with open(dns_path) as csvfile:
leases_reader = csv.reader(csvfile, delimiter=' ')
for row in leases_reader:
leases.append(row)