Comment 4 for bug 2066214

Revision history for this message
Martin Kopec (mkopec) wrote (last edit ):

as stated in the comment #1, the listing keypairs is basically broken in tempest cleanup. Before we were able, as admin, to list all keypairs .. however, now, we can list only the keypairs that belong to the current user or we need to specify --user <user id> when listing keypairs of other users, we can't simply list them all

Technically, in tempest cleanup, we could iterate over all the users (before we delete them) and delete their keypairs, however, tempest cleanup is used to delete left over resources. In the situation when a keypair was left behind and the user got somehow deleted, we can't delete the keypair as we can't even list it (openstack keypair list --user <deleted user id> obviously fails with "No user with that name or ID ...". Well, in that case we can't even tell if keypairs were left behind as we can't list them.

The next course of action should be:
1. figure out what happens to a keypair if a user that the keypair belongs to is deleted - is the keypair deleted too? is it deleted by a garbage collector of sorts? etc
2. A. if 1. is true, then let's modify the cleanup to delete the kepairs in a loop as iterating over the leftover users and that's it, we don't have to worry about the keypairs of deleted users
2. B if 1. is not true, we need to figure out the official way of deleting keypairs without specific user id