Drop a keyspace if it exists in a Cassandra cluster.

    :param keyspace:       The keyspace to drop.
    :type  keyspace:       str
    :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs.
    :type  contact_points: str | list[str]
    :param cql_user:       The Cassandra user if authentication is turned on.
    :type  cql_user:       str
    :param cql_pass:       The Cassandra user password if authentication is turned on.
    :type  cql_pass:       str
    :param port:           The Cassandra cluster port, defaults to None.
    :type  port:           int
    :return:               The info for the keyspace or False if it does not exist.
    :rtype:                dict

    CLI Example:

    .. code-block:: bash

        salt 'minion1' cassandra_cql.drop_keyspace keyspace=test

        salt 'minion1' cassandra_cql.drop_keyspace keyspace=test contact_points=minion1

def drop_keyspace(keyspace, contact_points=None, port=None, cql_user=None, cql_pass=None):
    '''
    Drop a keyspace if it exists in a Cassandra cluster.

    :param keyspace:       The keyspace to drop.
    :type  keyspace:       str
    :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs.
    :type  contact_points: str | list[str]
    :param cql_user:       The Cassandra user if authentication is turned on.
    :type  cql_user:       str
    :param cql_pass:       The Cassandra user password if authentication is turned on.
    :type  cql_pass:       str
    :param port:           The Cassandra cluster port, defaults to None.
    :type  port:           int
    :return:               The info for the keyspace or False if it does not exist.
    :rtype:                dict

    CLI Example:

    .. code-block:: bash

        salt 'minion1' cassandra_cql.drop_keyspace keyspace=test

        salt 'minion1' cassandra_cql.drop_keyspace keyspace=test contact_points=minion1
    '''
    existing_keyspace = keyspace_exists(keyspace, contact_points, port)
    if existing_keyspace:
        query = '''drop keyspace {0};'''.format(keyspace)
        try:
            cql_query(query, contact_points, port, cql_user, cql_pass)
        except CommandExecutionError:
            log.critical('Could not drop keyspace.')
            raise
        except BaseException as e:
            log.critical('Unexpected error while dropping keyspace: %s', e)
            raise

    return True