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
db2a38b7
Commit
db2a38b7
authored
Oct 15, 2021
by
janis.streib
🦉
Browse files
UPD: more manual serialization
parent
7b2ddbe8
Changes
1
Hide whitespace changes
Inline
Side-by-side
middleware/net_suite/modules/macfinder/views.py
View file @
db2a38b7
...
@@ -18,7 +18,7 @@ class MacFinderJob(DBObject):
...
@@ -18,7 +18,7 @@ class MacFinderJob(DBObject):
self
.
status
=
None
self
.
status
=
None
self
.
mac
=
format_mac
(
mac
)
self
.
mac
=
format_mac
(
mac
)
self
.
vendor
=
OUI_DB
.
get
(
self
.
mac
[:
8
],
None
)
self
.
vendor
=
OUI_DB
.
get
(
self
.
mac
[:
8
],
None
)
self
.
vlan
=
vlan
self
.
vlan
=
VLAN
(
**
vlan
)
self
.
bcd
=
bcd
self
.
bcd
=
bcd
def
poll
(
self
,
session
,
db
,
connection
):
def
poll
(
self
,
session
,
db
,
connection
):
...
@@ -63,7 +63,14 @@ def create_job():
...
@@ -63,7 +63,14 @@ def create_job():
created_jobs
.
append
(
job_id
)
created_jobs
.
append
(
job_id
)
pipe
=
r
.
pipeline
()
pipe
=
r
.
pipeline
()
pipe
.
multi
()
pipe
.
multi
()
pipe
.
set
(
job_id
,
json
.
dumps
({
'mac'
:
request
.
json
[
'mac'
],
'job_id'
:
job_id
,
'vlan'
:
vlan
,
'bcd'
:
vlan
.
bcd
}))
pipe
.
set
(
job_id
,
json
.
dumps
(
{
'mac'
:
request
.
json
[
'mac'
],
'job_id'
:
job_id
,
'vlan'
:
{
'id'
:
vlan
.
id
,
'name'
:
vlan
.
name
},
'bcd'
:
vlan
.
bcd
}
))
pipe
.
expire
(
job_id
,
60
*
60
*
12
)
pipe
.
expire
(
job_id
,
60
*
60
*
12
)
pipe
.
execute
()
pipe
.
execute
()
return
jsonify
({
'success'
:
True
,
'job_ids'
:
created_jobs
})
return
jsonify
({
'success'
:
True
,
'job_ids'
:
created_jobs
})
...
...
Write
Preview
Markdown
is supported
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