Fixing delete_leases function.

It was refering a non-existing variable.
This commit is contained in:
wilderrodrigues 2014-12-17 12:48:29 +01:00
parent 636dfd6217
commit 370fe518f2
1 changed files with 3 additions and 0 deletions

View File

@ -91,6 +91,7 @@ class CsDhcp(CsDataBag):
self.conf.search(sline, line)
def delete_leases(self):
changed = []
leases = []
try:
for line in open(LEASES):
@ -101,6 +102,8 @@ class CsDhcp(CsDataBag):
"host": bits[3],
"del": False
}
changed.append(to)
for v in changed:
if v['mac'] == to['mac'] or v['ip'] == to['ip'] or v['host'] == to['host']:
to['del'] = True