1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +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 json
import socket
@ -676,6 +677,7 @@ def inst_graph(request, compute_id, vname):
def guess_mac_address(request, vname):
dhcp_file = '/srv/webvirtcloud/dhcpd.conf'
data = { 'vname': vname, 'mac': '52:54:00:' }
if os.path.isfile(dhcp_file):
with open(dhcp_file, 'r') as f:
name_found = False
for line in f: