Commit ae993d64 authored by janis.streib's avatar janis.streib 🦉
Browse files

UPD: allow init from serialized json

parent c8159ce8
......@@ -12,12 +12,13 @@ import redis
class MacFinderJob(DBObject):
def __init__(self, job_id, mac, vlan, bcd):
def __init__(self, job_id, mac, vlan, bcd, finished=False, failed=False, status=None, vendor=None):
self.job_id = job_id
self.finished = self.failed = False
self.status = None
self.finished = finished
self.failed= failed
self.status = status
self.mac = format_mac(mac)
self.vendor = OUI_DB.get(self.mac[:8], None)
self.vendor = OUI_DB.get(self.mac[:8], None) if vendor is None else vendor
self.vlan = vlan if type(vlan) == VLAN else VLAN(**vlan)
self.bcd = bcd
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment