Commit 80f85ee9 authored by Janis Streib's avatar Janis Streib 🦉

ADD: macfinder: safe bcd

parent 403bb2ae
Pipeline #130074 passed with stages
in 5 minutes and 44 seconds
......@@ -10,7 +10,7 @@ import collections
from . import OUI_DB
class MacFinderJob(DBObject):
def __init__(self, job_id, mac, vlan):
def __init__(self, job_id, mac, vlan, bcd):
self.job_id = job_id
self.finished = self.failed = False
self.status = None
......@@ -18,6 +18,7 @@ class MacFinderJob(DBObject):
self.vendor = OUI_DB.get(self.mac[:8], None)
self.vlan = vlan
self.started = datetime.datetime.utcnow()
self.bcd = bcd
def poll(self, session, db, connection):
if self.finished:
......@@ -62,7 +63,7 @@ def create_job():
return jsonify({'success': False, 'error': 'internal_error'}), 500
job_id = resp.json()['job_id']
created_jobs.append(job_id)
job = MacFinderJob(job_id, request.json['mac'], vlan.id)
job = MacFinderJob(job_id, request.json['mac'], vlan.id, request.json['bcd'])
s['macfinder_jobs'][job_id] = job
s.save()
return jsonify({'success': True, 'job_ids': created_jobs})
......
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