Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org tomorrow, 2020/08/04, starting at approximately 9am PDT. It is expected to take around 15 minutes and there will be a short period of downtime towards the end of the maintenance window. Please direct any comments, questions or concerns to computing-help@ligo.org.

Commit 136cb502 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Add acct and certs for deepclean (ML noise cleaning)

parent c82be66c
Pipeline #43793 passed with stage
in 3 minutes and 44 seconds
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-01-04 18:39
from __future__ import unicode_literals
from django.db import migrations
ACCOUNT = {
'username': 'deepclean',
'email': 'michael.coughlin@ligo.org',
'first_name': '',
'last_name': 'LIGO/Virgo ML Noise Cleaning',
}
CERTS = [
'/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=ldas-pcdev2.ligo-wa.caltech.edu/CN=deepclean_lho/CN=Michael Coughlin/CN=UID:michael.coughlin.robot',
'/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=ldas-pcdev2.ligo-la.caltech.edu/CN=deepclean_llo/CN=Michael Coughlin/CN=UID:michael.coughlin.robot',
]
def create_account_and_certs(apps, schema_editor):
RobotUser = apps.get_model('ligoauth', 'RobotUser')
X509Cert = apps.get_model('ligoauth', 'X509Cert')
# Create user
user = RobotUser.objects.create(**ACCOUNT)
# Create X509 certificates
for subject in CERTS:
user.x509cert_set.create(subject=subject)
def delete_account_and_certs(apps, schema_editor):
RobotUser = apps.get_model('ligoauth', 'RobotUser')
X509Cert = apps.get_model('ligoauth', 'X509Cert')
# Get user
user = RobotUser.objects.get(username=ACCOUNT['username'])
# Delete certs
for cert in user.x509cert_set.filter(subject__in=CERTS):
cert.delete()
# Delete full User object
user.user_ptr.delete()
class Migration(migrations.Migration):
dependencies = [
('ligoauth', '0020_remove_old_dashboard_certs'),
]
operations = [
migrations.RunPython(create_account_and_certs,
delete_account_and_certs),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment