(cli, keypair)
Validate keypair

    validate the keypair, if provided.
Validate keypair
Validate keypair
def validate_keypair(cli, keypair):
    """Validate keypair

    validate the keypair, if provided.
    """
    if keypair is None:
        return
    try:
        cli.nova().keypairs.get(keypair)
    except nova_exception.NotFound:
        raise exception.KeyPairNotFound(keypair=keypair)
def validate_keypair ( cli , keypair ) : if keypair is None : return try : cli . nova ( ) . keypairs . get ( keypair ) except nova_exception . NotFound : raise exception . KeyPairNotFound ( keypair = keypair )