Skip to content

Commit

Permalink
commit write to pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 10, 2026
1 parent a5bee36 commit dfdf0b2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
9 changes: 6 additions & 3 deletions local-app/python-tools/idc-membership-check/idc_reconcile.csv
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ DELETED,,wadhw003,,"cn=wadhw003,ou=People,o=U.S. Census Bureau,c=US",groups-csv:
DELETED,,will0783,,"cn=will0783,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7535240,,separated (employeeType='contractor/separated')
DELETED,,xiao0010,,"cn=xiao0010,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7535240,,separated (employeeType='contractor/separated')
DELETED,,yang0347,,"cn=yang0347,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7535240,,separated (employeeType='contractor/separated')
DELETE,,pasla001,james.r.paslay@census.gov,,idc-only,,not in LDAP/CSV authoritative list
GROUP_PENDING_ADD,edl-u-7502891,bethe012,,"cn=bethe012,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7502891,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_ADD,edl-u-7502891,burke385,patrick.g.burke@census.gov,"cn=burke385,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-6000670|u-7502891|u-7512692|u-7533515,,"in LDAP group, missing from IDC group"
GROUP_PENDING_ADD,edl-u-7502891,ghand001,,"cn=ghand001,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7502891,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7502891,gombo001,,"cn=gombo001,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7502891,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7509890,franc350,,"cn=franc350,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7509890,,"in LDAP group, missing from IDC group (pending — no mail)"
Expand Down Expand Up @@ -113,6 +113,7 @@ GROUP_PENDING_ADD,edl-u-7532618,kota0301,,"cn=kota0301,ou=People,o=U.S. Census B
GROUP_PENDING_ADD,edl-u-7533284,felde309,,"cn=felde309,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533284,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7533284,jerom004,,"cn=jerom004,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533284,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7533284,krish010,,"cn=krish010,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533284,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_ADD,edl-u-7533284,pined015,daniel.a.pinedo@census.gov,"cn=pined015,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7530703|u-7530704|u-7530798|u-7533284,,"in LDAP group, missing from IDC group"
GROUP_PENDING_ADD,edl-u-7533284,santo336,,"cn=santo336,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533284,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7533292,lyle0001,,"cn=lyle0001,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533292,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7533292,steue001,,"cn=steue001,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533292,,"in LDAP group, missing from IDC group (pending — no mail)"
Expand All @@ -122,7 +123,8 @@ GROUP_PENDING_ADD,edl-u-7533301,vallu003,,"cn=vallu003,ou=People,o=U.S. Census B
GROUP_PENDING_ADD,edl-u-7533323,nguye020,,"cn=nguye020,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533323,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7533323,peter008,,"cn=peter008,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533323,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7533337,rao00308,,"cn=rao00308,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533337,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_DELETE,edl-u-7533453,pasla001,james.r.paslay@census.gov,,groups-csv:u-7533453,,"in IDC group, no longer in LDAP group"
GROUP_ADD,edl-u-7533515,gilbe322,timothy.r.gilbert@census.gov,"cn=gilbe322,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533515|u-7535974,,"in LDAP group, missing from IDC group"
GROUP_ADD,edl-u-7533515,tolli005,kevin.p.tolliver@census.gov,"cn=tolli005,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533515|u-7535974,,"in LDAP group, missing from IDC group"
GROUP_PENDING_ADD,edl-u-7533841,asial001,,"cn=asial001,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533841,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7533841,blake350,,"cn=blake350,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533841,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7533841,burro320,,"cn=burro320,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7533841,,"in LDAP group, missing from IDC group (pending — no mail)"
Expand All @@ -132,7 +134,6 @@ GROUP_PENDING_ADD,edl-u-7534776,richa563,,"cn=richa563,ou=People,o=U.S. Census B
GROUP_PENDING_ADD,edl-u-7534816,musht001,,"cn=musht001,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534776|u-7534816|u-7535341|u-7537690,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7534816,richa563,,"cn=richa563,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534776|u-7534816|u-7535341|u-7537690,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7534861,dutto307,,"cn=dutto307,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534861,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_ADD,edl-u-7534876,clark671,mary.eunice.joy.z.clark@census.gov,"cn=clark671,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534876|u-7535836,,"in LDAP group, missing from IDC group"
GROUP_PENDING_ADD,edl-u-7535240,chan0348,,"cn=chan0348,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7535240,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7535240,crane318,,"cn=crane318,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7535240,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7535240,das00008,,"cn=das00008,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7535240,,"in LDAP group, missing from IDC group (pending — no mail)"
Expand All @@ -152,5 +153,7 @@ GROUP_PENDING_ADD,edl-u-7535240,yang0347,,"cn=yang0347,ou=People,o=U.S. Census B
GROUP_PENDING_ADD,edl-u-7535341,musht001,,"cn=musht001,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534776|u-7534816|u-7535341|u-7537690,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7535341,richa563,,"cn=richa563,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534776|u-7534816|u-7535341|u-7537690,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7535374,lecle301,,"cn=lecle301,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7535374,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_ADD,edl-u-7535565,bullo319,dirk.m.bullock@census.gov,"cn=bullo319,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7529860|u-7531619|u-7534876|u-7535565|u-7535836,,"in LDAP group, missing from IDC group"
GROUP_ADD,edl-u-7535565,clark671,mary.eunice.joy.z.clark@census.gov,"cn=clark671,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534876|u-7535565|u-7535836,,"in LDAP group, missing from IDC group"
GROUP_PENDING_ADD,edl-u-7537690,musht001,,"cn=musht001,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534776|u-7534816|u-7535341|u-7537690,,"in LDAP group, missing from IDC group (pending — no mail)"
GROUP_PENDING_ADD,edl-u-7537690,richa563,,"cn=richa563,ou=People,o=U.S. Census Bureau,c=US",groups-csv:u-7534776|u-7534816|u-7535341|u-7537690,,"in LDAP group, missing from IDC group (pending — no mail)"
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ USER,morse321,,0,0,1
USER,musht001,,0,0,1
USER,nguye020,,0,1,0
USER,nicho016,,0,1,0
USER,pasla001,james.r.paslay@census.gov,0,1,0
USER,patel382,,0,1,0
USER,peter008,,0,1,0
USER,piele001,,0,1,0
Expand All @@ -74,7 +73,7 @@ USER,wells399,,0,0,1
USER,will0783,,0,1,0
USER,xiao0010,,0,1,0
USER,yang0347,,0,1,0
GROUP,edl-u-7502891,,0,0,3
GROUP,edl-u-7502891,,1,0,3
GROUP,edl-u-7509890,,0,0,1
GROUP,edl-u-7525174,,0,0,1
GROUP,edl-u-7526458,,0,0,2
Expand All @@ -84,19 +83,19 @@ GROUP,edl-u-7530156,,0,0,17
GROUP,edl-u-7530703,,0,0,1
GROUP,edl-u-7531798,,0,0,2
GROUP,edl-u-7532618,,0,0,3
GROUP,edl-u-7533284,,0,0,4
GROUP,edl-u-7533284,,1,0,4
GROUP,edl-u-7533292,,0,0,2
GROUP,edl-u-7533297,,0,0,1
GROUP,edl-u-7533301,,0,0,2
GROUP,edl-u-7533323,,0,0,2
GROUP,edl-u-7533337,,0,0,1
GROUP,edl-u-7533453,,0,1,0
GROUP,edl-u-7533515,,2,0,0
GROUP,edl-u-7533841,,0,0,4
GROUP,edl-u-7534776,,0,0,2
GROUP,edl-u-7534816,,0,0,2
GROUP,edl-u-7534861,,0,0,1
GROUP,edl-u-7534876,,1,0,0
GROUP,edl-u-7535240,,0,0,16
GROUP,edl-u-7535341,,0,0,2
GROUP,edl-u-7535374,,0,0,1
GROUP,edl-u-7535565,,2,0,0
GROUP,edl-u-7537690,,0,0,2
22 changes: 11 additions & 11 deletions local-app/python-tools/idc-membership-check/user_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cleanup()
trap cleanup EXIT

THIS=$(basename $0 .sh)
VERSION="1.1.4"
VERSION="1.2.0"
# set -euo pipefail
export TMPDIR=$(/bin/mktemp -d /tmp/user_update.XXXXXXXX) || (echo "#* error making TMPDIR" && exit 1)

Expand Down Expand Up @@ -43,44 +43,44 @@ echo "## $text"
C=$(( C + 1 ))
text="$C/$TASKS: users ADD"
echo "## $text"
echo $text > "$STATUS_PIPE"
## echo $text > "$STATUS_PIPE"
u_add=$(awk -F, 'NR>1 { if ($1=="USER" && $4==1) { print $2 }}' $SUMMARY_CSV)
c_add=$(awk -F, 'NR>1 { if ($1=="USER" && $4==1) { c+=1 }} END {print c}' $SUMMARY_CSV)
if [ -z $c_add ]
then
c_add=0
fi
echo "PROGRESS:$C/$TASKS" > "$STATUS_PIPE"
## echo "PROGRESS:$C/$TASKS" > "$STATUS_PIPE"

C=$(( C + 1 ))
text="$C/$TASKS: users DELETE"
echo "## $text"
echo $text > "$STATUS_PIPE"
## echo $text > "$STATUS_PIPE"
u_delete=$(awk -F, 'NR>1 { if ($1=="USER" && $3!="" && $5==1) { print $2 }}' $SUMMARY_CSV)
c_delete=$(awk -F, 'NR>1 { if ($1=="USER" && $3!="" && $5==1) { c+=1 }} END {print c}' $SUMMARY_CSV)
if [ -z $c_delete ]
then
c_delete=0
fi
echo "PROGRESS:$C/$TASKS" > "$STATUS_PIPE"
## echo "PROGRESS:$C/$TASKS" > "$STATUS_PIPE"

C=$(( C + 1 ))
text="$C/$TASKS: users PENDING-ADD"
echo "## $text"
echo $text > "$STATUS_PIPE"
## echo $text > "$STATUS_PIPE"
u_pending_add=$(awk -F, 'NR>1 { if ($1=="USER" && $6==1) { print $2 }}' $SUMMARY_CSV)
c_pending_add=$(awk -F, 'NR>1 { if ($1=="USER" && $6==1) { c+=1 }} END {print c}' $SUMMARY_CSV)
if [ -z $c_pending_add ]
then
c_pending_add=0
fi
echo "PROGRESS:$C/$TASKS" > "$STATUS_PIPE"
## echo "PROGRESS:$C/$TASKS" > "$STATUS_PIPE"

set -euo pipefail
C=$(( C + 1 ))
text="$C/$TASKS: tf-apply targets (add $c_add)"
echo "## $text"
echo $text > "$STATUS_PIPE"
## echo $text > "$STATUS_PIPE"
if [ $c_add -gt 0 ]
then
targets=""
Expand All @@ -100,7 +100,7 @@ set +euo pipefail
C=$(( C + 1 ))
text="$C/$TASKS: remove users from .csv"
echo "## $text"
echo $text > "$STATUS_PIPE"
## echo $text > "$STATUS_PIPE"
if [ $c_delete -gt 0 ]
then
for u in $u_delete
Expand All @@ -113,7 +113,7 @@ fi
C=$(( C + 1 ))
text="$C/$TASKS: remove users from .yml files"
echo "## $text"
echo $text > "$STATUS_PIPE"
## echo $text > "$STATUS_PIPE"
if [ $c_delete -gt 0 ]
then
for u in $u_delete
Expand All @@ -127,7 +127,7 @@ set -euo pipefail
C=$(( C + 1 ))
text="$C/$TASKS: tf-apply targets (delete $c_delete)"
echo "## $text"
echo $text > "$STATUS_PIPE"
## echo $text > "$STATUS_PIPE"
if [ $c_delete -gt 0 ]
then
targets=""
Expand Down

0 comments on commit dfdf0b2

Please sign in to comment.