'Delete credential containing ec2 keypair.'

def delete_ec2_keypair(self, credential_id=None, access=None, user_id=None):

    if credential_id:
        try:
            self.client.credentials.delete(credential_id)
        except ks_exception.NotFound:
            pass
    elif access:
        cred = self._find_ec2_keypair(access=access, user_id=user_id)
        if cred:
            self.client.credentials.delete(cred.id)
    else:
        raise ValueError('Must    specify    either    credential_id    or    access')
