Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
scc-net
netvs
netvs-core
Commits
80f85ee9
Commit
80f85ee9
authored
Jan 27, 2021
by
janis.streib
🦉
Browse files
ADD: macfinder: safe bcd
parent
403bb2ae
Pipeline
#130074
passed with stages
in 5 minutes and 44 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
middleware/net_suite/modules/macfinder/views.py
View file @
80f85ee9
...
...
@@ -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
})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment