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
cff55b4d
Commit
cff55b4d
authored
May 31, 2019
by
Tanner Prestegard
Committed by
GraceDB
Jun 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix up old migrations to work with new Group names
parent
9563902e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
14 deletions
+41
-14
gracedb/ligoauth/migrations/0003_initial_localuser_and_x509cert_data.py
...th/migrations/0003_initial_localuser_and_x509cert_data.py
+5
-2
gracedb/ligoauth/migrations/0005_update_emfollow_accounts.py
gracedb/ligoauth/migrations/0005_update_emfollow_accounts.py
+6
-2
gracedb/ligoauth/migrations/0007_update_gstlalcbctest.py
gracedb/ligoauth/migrations/0007_update_gstlalcbctest.py
+6
-2
gracedb/ligoauth/migrations/0021_create_deepclean_account_and_certs.py
...uth/migrations/0021_create_deepclean_account_and_certs.py
+6
-2
gracedb/ligoauth/migrations/0024_create_gwhen_account_and_certs.py
...igoauth/migrations/0024_create_gwhen_account_and_certs.py
+6
-2
gracedb/ligoauth/migrations/0028_create_gbm_followup_account_and_certs.py
.../migrations/0028_create_gbm_followup_account_and_certs.py
+6
-2
gracedb/ligoauth/migrations/0032_create_gweventlistener_acct_and_cert.py
...h/migrations/0032_create_gweventlistener_acct_and_cert.py
+6
-2
No files found.
gracedb/ligoauth/migrations/0003_initial_localuser_and_x509cert_data.py
View file @
cff55b4d
...
...
@@ -3,7 +3,10 @@
from
__future__
import
unicode_literals
from
django.db
import
migrations
from
django.conf
import
settings
# 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'
# List of robot user account information and their corresponding
# x509 certificate subjects. Based on current production database
...
...
@@ -345,7 +348,7 @@ def add_localusers_and_x509certs(apps, schema_editor):
Group
=
apps
.
get_model
(
'auth'
,
'Group'
)
# Create user accounts
lvc_group
=
Group
.
objects
.
get
(
name
=
settings
.
LVC_GROUP
)
lvc_group
=
Group
.
objects
.
get
(
name
=
LVC_GROUP
)
for
l_dict
in
LOCALUSERS
:
localuser
,
created
=
LocalUser
.
objects
.
get_or_create
(
username
=
l_dict
[
'username'
])
localuser
.
last_name
=
l_dict
[
'last_name'
]
...
...
gracedb/ligoauth/migrations/0005_update_emfollow_accounts.py
View file @
cff55b4d
...
...
@@ -8,7 +8,11 @@
from
__future__
import
unicode_literals
from
django.db
import
migrations
from
django.conf
import
settings
# 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_ACCOUNTS
=
{
'gdb-processor'
:
{
...
...
@@ -61,7 +65,7 @@ def deactivate_old_and_add_new_accounts(apps, schema_editor):
new_user
.
x509cert_set
.
create
(
subject
=
subject
)
# Add user to LVC group
group
=
Group
.
objects
.
get
(
name
=
settings
.
LVC_GROUP
)
group
=
Group
.
objects
.
get
(
name
=
LVC_GROUP
)
group
.
user_set
.
add
(
new_user
)
def
activate_old_and_remove_new_accounts
(
apps
,
schema_editor
):
...
...
gracedb/ligoauth/migrations/0007_update_gstlalcbctest.py
View file @
cff55b4d
...
...
@@ -2,7 +2,11 @@
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
from
django.conf
import
settings
# 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'
ROBOTS
=
[
{
...
...
@@ -20,7 +24,7 @@ def create_robots(apps, schema_editor):
LocalUser
=
apps
.
get_model
(
'ligoauth'
,
'LocalUser'
)
X509Cert
=
apps
.
get_model
(
'ligoauth'
,
'X509Cert'
)
Group
=
apps
.
get_model
(
'auth'
,
'Group'
)
lvc_group
=
Group
.
objects
.
get
(
name
=
settings
.
LVC_GROUP
)
lvc_group
=
Group
.
objects
.
get
(
name
=
LVC_GROUP
)
for
entry
in
ROBOTS
:
user
,
created
=
LocalUser
.
objects
.
get_or_create
(
username
=
entry
[
'username'
])
...
...
gracedb/ligoauth/migrations/0021_create_deepclean_account_and_certs.py
View file @
cff55b4d
...
...
@@ -2,9 +2,13 @@
# Generated by Django 1.11.16 on 2019-01-04 18:39
from
__future__
import
unicode_literals
from
django.conf
import
settings
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'
ACCOUNT
=
{
'username'
:
'deepclean'
,
'email'
:
'michael.coughlin@ligo.org'
,
...
...
@@ -27,7 +31,7 @@ def create_account_and_certs(apps, schema_editor):
user
=
RobotUser
.
objects
.
create
(
**
ACCOUNT
)
# Add user to LVC group
group
=
Group
.
objects
.
get
(
name
=
settings
.
LVC_GROUP
)
group
=
Group
.
objects
.
get
(
name
=
LVC_GROUP
)
group
.
user_set
.
add
(
user
)
# Create X509 certificates
...
...
gracedb/ligoauth/migrations/0024_create_gwhen_account_and_certs.py
View file @
cff55b4d
...
...
@@ -2,9 +2,13 @@
# Generated by Django 1.11.18 on 2019-02-18 19:50
from
__future__
import
unicode_literals
from
django.conf
import
settings
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'
ACCOUNT
=
{
'username'
:
'Gwhen'
,
'email'
:
'stefan.countryman@ligo.org'
,
...
...
@@ -26,7 +30,7 @@ def create_account_and_certs(apps, schema_editor):
user
=
RobotUser
.
objects
.
create
(
**
ACCOUNT
)
# Add user to LVC group
group
=
Group
.
objects
.
get
(
name
=
settings
.
LVC_GROUP
)
group
=
Group
.
objects
.
get
(
name
=
LVC_GROUP
)
group
.
user_set
.
add
(
user
)
# Create X509 certificates
...
...
gracedb/ligoauth/migrations/0028_create_gbm_followup_account_and_certs.py
View file @
cff55b4d
...
...
@@ -2,9 +2,13 @@
# Generated by Django 1.11.18 on 2019-03-27 17:12
from
__future__
import
unicode_literals
from
django.conf
import
settings
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'
ACCOUNT
=
{
'username'
:
'fermi-gbm-follow-up'
,
'email'
:
'tyson.littenberg@ligo.org'
,
...
...
@@ -26,7 +30,7 @@ def create_account_and_certs(apps, schema_editor):
user
=
RobotUser
.
objects
.
create
(
**
ACCOUNT
)
# Add user to LVC group
group
=
Group
.
objects
.
get
(
name
=
settings
.
LVC_GROUP
)
group
=
Group
.
objects
.
get
(
name
=
LVC_GROUP
)
group
.
user_set
.
add
(
user
)
# Create X509 certificates
...
...
gracedb/ligoauth/migrations/0032_create_gweventlistener_acct_and_cert.py
View file @
cff55b4d
...
...
@@ -2,9 +2,13 @@
# Generated by Django 1.11.20 on 2019-05-14 17:48
from
__future__
import
unicode_literals
from
django.conf
import
settings
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'
ACCOUNT
=
{
'username'
:
'gweventlistener'
,
'email'
:
'rachel.scrandis@ligo.org'
,
...
...
@@ -22,7 +26,7 @@ def create_acct_and_cert(apps, schema_editor):
user
=
RobotUser
.
objects
.
create
(
**
ACCOUNT
)
# Add user to LVC group
group
=
Group
.
objects
.
get
(
name
=
settings
.
LVC_GROUP
)
group
=
Group
.
objects
.
get
(
name
=
LVC_GROUP
)
group
.
user_set
.
add
(
user
)
# Create new certificate
...
...
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