Project

General

Profile

Feature #14747

Add a script to extract VO Role=Production user info

Added by Marc Mengel almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
12/02/2016
Due date:
% Done:

100%

Estimated time:
Scope:
Internal
Experiment:
-
Stakeholders:
Duration:

Description

We should look at dumping the experiment VO's and adding production
users to the experiment in POMS. Joe Boyd has a script like that for Fifemon
we could pillage.

History

#1 Updated by Joe Boyd almost 4 years ago

A json dump of what users are in what pro account.

#2 Updated by Joe Boyd over 3 years ago

The script /home/poms/bin/proAccount_slurper.sh on fermicloud045 produces output like so:

{
"lariatpro" : "ahandres",
"lariatpro" : "brebel",
"lariatpro" : "diesburg",
"lariatpro" : "johnnyho",
"lariatpro" : "kherner",
"lariatpro" : "mazzacan",
"lariatpro" : "mengel",
"lariatpro" : "mfattoru",
"lariatpro" : "neha",
"lariatpro" : "pbuitrag",
"lariatpro" : "qhuang",
"lariatpro" : "stjohn",
"lariatpro" : "vito",
"novapro" : "ahandres",
"novapro" : "ahimmel",
"novapro" : "amitsmu",
"novapro" : "amoren",
"novapro" : "anorman",
"novapro" : "arrieta1",
"novapro" : "aurisano",
"novapro" : "bckhouse",
"novapro" : "biaow",
"novapro" : "boyd",
"novapro" : "brebel",
"novapro" : "bzamoran",
"novapro" : "crisprin",
"novapro" : "dbox",
"novapro" : "dingpf",
"novapro" : "dmendez",
"novapro" : "edniner",
"novapro" : "garzogli",
"novapro" : "gjdavies",
"novapro" : "greenc",
"novapro" : "group",
"novapro" : "gsdavies",
"novapro" : "illingwo",
"novapro" : "jteheran",
"novapro" : "kherner",
"novapro" : "kmatera",
"novapro" : "kretzke",
"novapro" : "kreymer",
"novapro" : "ksachdev",
"novapro" : "lcremone",
"novapro" : "lisa",
"novapro" : "liuji312",
"novapro" : "lozierj",
"novapro" : "macero",
"novapro" : "mazzacan",
"novapro" : "mengel",
"novapro" : "messier",
"novapro" : "mfattoru",
"novapro" : "mylab",
"novapro" : "pbuitrag",
"novapro" : "prabhjot",
"novapro" : "projas",
"novapro" : "psihas",
"novapro" : "qhuang",
"novapro" : "radovic",
"novapro" : "ranjan",
"novapro" : "rijeeshk",
"novapro" : "rocco",
"novapro" : "rschroet",
"novapro" : "rtoner",
"novapro" : "satish",
"novapro" : "sbhat",
"novapro" : "siva1987",
"novapro" : "stognini",
"novapro" : "tamsett",
"novapro" : "tghosh",
"novapro" : "tlevshin",
"novapro" : "tpropp",
"novapro" : "txin",
"novapro" : "vbychkov",
"novapro" : "vito",
"novapro" : "vokac",
"novapro" : "vold",
"novapro" : "ynitin",
"uboonepro" : "ahandres",
"uboonepro" : "diesburg",
"uboonepro" : "greenlee",
"uboonepro" : "joelam",
"uboonepro" : "kirby",
"uboonepro" : "mengel",
"uboonepro" : "mfattoru",
"uboonepro" : "moon2610",
"uboonepro" : "sbhat",
"uboonepro" : "tlevshin",
"uboonepro" : "tpropp",
"uboonepro" : "vito",
}

Is that what is needed?

#3 Updated by Joe Boyd over 3 years ago

  • % Done changed from 0 to 80

#4 Updated by Joe Boyd over 3 years ago

Also I wasn't sure where this should go in the repo. In the "cron" directory??

#5 Updated by Joe Boyd over 3 years ago

Sticking the whole script here since it's short. Talked to Steve and we're going to wait until next week and discuss this with Marc. Not sure how this fits in with new ideas on more levels of authorization that have been discussed.

#!/bin/sh

echo "{"
for exp in lariat nova uboone
do
AccountList=`curl -sk --cert ~/private/gsi/pomscert.pem --key ~/private/gsi/
pomskey.pem https://gums2.fnal.gov:8443/gums/map_account.jsp?accountName=${exp}p
ro | grep 'CN=UID:' | awk 'BEGIN {FS=":"} {print $NF}' | sort -u`
for username in $AccountList
do
echo "\"${exp}pro\" : \"$username\","
done
done
echo "}"

#6 Updated by Joe Boyd over 3 years ago

  • Status changed from New to Under Discussion

#7 Updated by Joe Boyd over 3 years ago

  • Assignee changed from Joe Boyd to Stephen White

Moving this over to Steve to finish up. My script is in crontab

25 1 * * * /home/poms/bin/grabPro.py > /home/poms/private/var/voms/prousers.json

and checked into master branch in the bin directory. It writes that file once a day and Steve will put the users into the database.

#8 Updated by Stephen White over 3 years ago

  • Status changed from Under Discussion to Work in progress

#9 Updated by Stephen White over 3 years ago

  • Status changed from Work in progress to Closed
  • % Done changed from 80 to 100

adduser.py created. It reads the JSON file and insert users who are not already there. It also adds users to existing experiment if not already in it.



Also available in: Atom PDF