# get the yubikey for the user from the fas configs db
for username in usernames:
fas = fasdb.cursor()
fas.execute("select value from configs, people where people.id = configs.person_id and username=%s and application = 'yubikey' and attribute = 'prefix'", (username,))
prefix = fas.fetchall()[0]
# Remove the keys from the yubikey database
yk_ksm = yk_ksmdb.cursor()
yk_ksm.execute('delete from yubikeys where publicname=%s', (prefix[0],))
yk_val = yk_valdb.cursor()
yk_val.execute('delete from yubikeys where yk_publicname=%s', (prefix[0],))
# Remove the key from fas
fas.execute("delete from configs where person_id = (select id from people where username=%s) and application = 'yubikey'", (username,))