From 8f8f928d03338d838644adf2cecd740ce7dbe7fc Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 21 Jan 2020 22:14:49 +0000 Subject: [PATCH] koji sync: the user_kbr_principals table users user_id and not username, update for the change Signed-off-by: Kevin Fenzi --- .../staging-sync/templates/koji-reset-staging.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql index 8d4bbaca85..8fbdc77fab 100644 --- a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql +++ b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql @@ -116,13 +116,13 @@ insert into cg_users (cg_id, user_id, creator_id) values ( {% endfor %} -- Fix krb principals for some users -{% for username, principal in [('releng', 'compose/koji.stg.fedoraproject.org'), - ('koschei', 'koschei/koschei-backend01.stg.phx2.fedoraproject.org'), - ('hotness', 'hotness/hotness01.stg.phx2.fedoraproject.org'), - ('containerbuild', 'osbs/osbs.stg.fedoraproject.org'), - ('bodhi', 'bodhi/bodhi.stg.fedoraproject.org'), - ('kojira', 'kojira/koji.stg.fedoraproject.org')] %} -update user_krb_principals set krb_principal='{{principal}}@STG.FEDORAPROJECT.ORG' where name='{{username}}'; +{% for user_id, principal in [('3445', 'compose/koji.stg.fedoraproject.org'), + ('3199', 'koschei/koschei-backend01.stg.phx2.fedoraproject.org'), + ('3139', 'hotness/hotness01.stg.phx2.fedoraproject.org'), + ('3538', 'osbs/osbs.stg.fedoraproject.org'), + ('428', 'bodhi/bodhi.stg.fedoraproject.org'), + ('129', 'kojira/koji.stg.fedoraproject.org')] %} +update user_krb_principals set krb_principal='{{principal}}@STG.FEDORAPROJECT.ORG' where user_id='{{user_id}}'; {% endfor %} update user_krb_principals set krb_principal=replace(krb_principal, '@FEDORAPROJECT.ORG', '@STG.FEDORAPROJECT.ORG');