Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
G
gracedb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
99
Issues
99
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lscsoft
gracedb
Commits
543ed965
Commit
543ed965
authored
Jun 27, 2019
by
Tanner Prestegard
Committed by
GraceDB
Aug 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix migration for creating geo-ext-trig account
parent
61995562
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
gracedb/ligoauth/migrations/0023_update_geo_cert.py
gracedb/ligoauth/migrations/0023_update_geo_cert.py
+10
-0
No files found.
gracedb/ligoauth/migrations/0023_update_geo_cert.py
View file @
543ed965
...
...
@@ -4,6 +4,11 @@ from __future__ import unicode_literals
from
django.db
import
migrations
# Previously, this was taken from settings.LVC_GROUP, but that value has
# changed. So we have to hard-code it for past migrations
LVC_GROUP
=
'Communities:LSCVirgoLIGOGroupMembers'
OLD
=
{
'username'
:
'gerrit.kuehn@LIGO.ORG'
,
'cert'
:
'/DC=org/DC=ligo/O=LIGO/OU=Services/CN=ext-alert/geo-ws4.geo.rt.aei.uni-hannover.de'
,
...
...
@@ -21,6 +26,7 @@ NEW_CERT = '/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=geo-ws4.geo.rt.aei.uni-h
def
add_account_and_update_certs
(
apps
,
schema_editor
):
RobotUser
=
apps
.
get_model
(
'ligoauth'
,
'RobotUser'
)
X509Cert
=
apps
.
get_model
(
'ligoauth'
,
'X509Cert'
)
Group
=
apps
.
get_model
(
'auth'
,
'Group'
)
# Delete old_cert
old_cert
=
X509Cert
.
objects
.
filter
(
subject
=
OLD
[
'cert'
])
...
...
@@ -34,6 +40,10 @@ def add_account_and_update_certs(apps, schema_editor):
# Create new certificate
user
.
x509cert_set
.
create
(
subject
=
NEW_CERT
)
# Add user to internal group
group
=
Group
.
objects
.
get
(
name
=
LVC_GROUP
)
group
.
user_set
.
add
(
user
)
def
remove_account_and_revert_certs
(
apps
,
schema_editor
):
User
=
apps
.
get_model
(
'auth'
,
'User'
)
...
...
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