Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
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
...
@@ -4,6 +4,11 @@ from __future__ import unicode_literals
from
django.db
import
migrations
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
=
{
OLD
=
{
'username'
:
'gerrit.kuehn@LIGO.ORG'
,
'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'
,
'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
...
@@ -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
):
def
add_account_and_update_certs
(
apps
,
schema_editor
):
RobotUser
=
apps
.
get_model
(
'ligoauth'
,
'RobotUser'
)
RobotUser
=
apps
.
get_model
(
'ligoauth'
,
'RobotUser'
)
X509Cert
=
apps
.
get_model
(
'ligoauth'
,
'X509Cert'
)
X509Cert
=
apps
.
get_model
(
'ligoauth'
,
'X509Cert'
)
Group
=
apps
.
get_model
(
'auth'
,
'Group'
)
# Delete old_cert
# Delete old_cert
old_cert
=
X509Cert
.
objects
.
filter
(
subject
=
OLD
[
'cert'
])
old_cert
=
X509Cert
.
objects
.
filter
(
subject
=
OLD
[
'cert'
])
...
@@ -34,6 +40,10 @@ def add_account_and_update_certs(apps, schema_editor):
...
@@ -34,6 +40,10 @@ def add_account_and_update_certs(apps, schema_editor):
# Create new certificate
# Create new certificate
user
.
x509cert_set
.
create
(
subject
=
NEW_CERT
)
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
):
def
remove_account_and_revert_certs
(
apps
,
schema_editor
):
User
=
apps
.
get_model
(
'auth'
,
'User'
)
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