def isDse()

in ccmlib/dse/dse_cluster.py [0:0]


def isDse(install_dir, options=None):
    if install_dir is None:
        raise ArgumentError('Undefined installation directory')
    bin_dir = os.path.join(install_dir, common.BIN_DIR)
    if options and options.dse and './' != install_dir and not os.path.exists(bin_dir):
        raise ArgumentError('Installation directory does not contain a bin directory: %s' % install_dir)
    if options and options.dse:
        return True
    dse_script = os.path.join(bin_dir, 'dse')
    if options and not options.dse and './' != install_dir and os.path.exists(dse_script):
        raise ArgumentError('Installation directory is DSE but options did not specify `--dse`: %s' % install_dir)
    return os.path.exists(dse_script)