Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FoD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schmitz
FoD
Commits
e173e7c2
Commit
e173e7c2
authored
13 years ago
by
Leonidas Poulopoulos
Browse files
Options
Downloads
Patches
Plain Diff
Fixed issue with admininactive syncing. Fixed issue with admin batch delete
parent
6d153302
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
flowspec/admin.py
+0
-2
0 additions, 2 deletions
flowspec/admin.py
flowspec/models.py
+6
-6
6 additions, 6 deletions
flowspec/models.py
flowspec/tasks.py
+2
-0
2 additions, 0 deletions
flowspec/tasks.py
with
8 additions
and
8 deletions
flowspec/admin.py
+
0
−
2
View file @
e173e7c2
...
...
@@ -7,14 +7,12 @@ from django.contrib.auth.models import User
from
django.contrib.auth.admin
import
UserAdmin
from
accounts.models
import
UserProfile
class
RouteAdmin
(
admin
.
ModelAdmin
):
actions
=
[
'
deactivate
'
]
def
deactivate
(
self
,
request
,
queryset
):
queryset
=
queryset
.
filter
(
status
=
'
ACTIVE
'
)
rows
=
queryset
.
update
(
status
=
'
PENDING
'
)
response
=
batch_delete
.
delay
(
queryset
,
reason
=
"
ADMININACTIVE
"
)
self
.
message_user
(
request
,
"
Added request %s to job que. Check in a while for result
"
%
response
)
deactivate
.
short_description
=
"
Remove selected routes from network
"
...
...
This diff is collapsed.
Click to expand it.
flowspec/models.py
+
6
−
6
View file @
e173e7c2
...
...
@@ -249,12 +249,12 @@ class Route(models.Model):
except
:
pass
if
found
and
self
.
status
!=
"
ACTIVE
"
:
logger
.
error
(
'
Rule is applied on device but appears as offline
'
)
self
.
status
=
"
ACTIVE
"
self
.
save
()
found
=
True
if
not
found
and
self
.
status
==
"
ADMININACTIVE
"
:
found
=
True
logger
.
error
(
'
Rule is applied on device but appears as offline
'
)
self
.
status
=
"
ACTIVE
"
self
.
save
()
found
=
True
if
self
.
status
==
"
ADMININACTIVE
"
:
found
=
True
return
found
def
get_then
(
self
):
...
...
This diff is collapsed.
Click to expand it.
flowspec/tasks.py
+
2
−
0
View file @
e173e7c2
...
...
@@ -61,6 +61,8 @@ def delete(route, **kwargs):
@task
def
batch_delete
(
routes
,
**
kwargs
):
if
routes
:
for
route
in
routes
:
route
.
status
=
'
PENDING
'
;
route
.
save
()
applier
=
PR
.
Applier
(
route_objects
=
routes
)
conf
=
applier
.
delete_routes
()
commit
,
response
=
applier
.
apply
(
configuration
=
conf
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment