1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-03-20 20:12:59 +00:00

guess_mac checks for existing dhcp_file

This commit is contained in:
Jan Krcmar 2016-02-11 14:48:41 +01:00
parent 16510dee59
commit 510e0e6ee5

View file

@ -1,3 +1,4 @@
import os
import time import time
import json import json
import socket import socket
@ -676,6 +677,7 @@ def inst_graph(request, compute_id, vname):
def guess_mac_address(request, vname): def guess_mac_address(request, vname):
dhcp_file = '/srv/webvirtcloud/dhcpd.conf' dhcp_file = '/srv/webvirtcloud/dhcpd.conf'
data = { 'vname': vname, 'mac': '52:54:00:' } data = { 'vname': vname, 'mac': '52:54:00:' }
if os.path.isfile(dhcp_file):
with open(dhcp_file, 'r') as f: with open(dhcp_file, 'r') as f:
name_found = False name_found = False
for line in f: for line in f: