Sorry, I thought we have already created a base class for KeyPair objects, but that's not the case yet (https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/openstack.py#L1128).

Leave it as it is for now and I'll create a base Keypair object and update this code to use it some time in the near future.