From 899f1c7aa628f5bba8bc995796cd27121e747067 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 21 Jan 2020 21:55:53 +0000 Subject: [PATCH] koji sync sql: koji 1.19 moved krb to a user_krb_principals table Signed-off-by: Kevin Fenzi --- .../manual/staging-sync/templates/koji-reset-staging.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql index 15b32f9dda..8d4bbaca85 100644 --- a/playbooks/manual/staging-sync/templates/koji-reset-staging.sql +++ b/playbooks/manual/staging-sync/templates/koji-reset-staging.sql @@ -83,7 +83,7 @@ select now() as time, 'adding staging host {{ host }}' as msg; delete from host_config where host_id in (select id from host where name='{{host}}'); delete from host where name='{{ host }}'; delete from users where name='{{ host }}'; -insert into users (name, usertype, krb_principal, status) values ('{{ host }}', 1, 'compile/{{ host }}@STG.FEDORAPROJECT.ORG', 0); +insert into user_krb_principals (name, user_krb_principal) values ('{{ host }}', 'compile/{{ host }}@STG.FEDORAPROJECT.ORG'); insert into host (user_id, name) values ( (select id from users where name='{{host}}'), '{{host}}'); insert into host_config (host_id, arches, creator_id) values ( @@ -122,8 +122,8 @@ insert into cg_users (cg_id, user_id, creator_id) values ( ('containerbuild', 'osbs/osbs.stg.fedoraproject.org'), ('bodhi', 'bodhi/bodhi.stg.fedoraproject.org'), ('kojira', 'kojira/koji.stg.fedoraproject.org')] %} -update users set krb_principal='{{principal}}@STG.FEDORAPROJECT.ORG' where name='{{username}}'; +update user_krb_principals set krb_principal='{{principal}}@STG.FEDORAPROJECT.ORG' where name='{{username}}'; {% endfor %} -update users set krb_principal=replace(krb_principal, '@FEDORAPROJECT.ORG', '@STG.FEDORAPROJECT.ORG'); +update user_krb_principals set krb_principal=replace(krb_principal, '@FEDORAPROJECT.ORG', '@STG.FEDORAPROJECT.ORG'); -- TODO fix kojipkgs url in external repos