def enable_dse(dse_repo_url, dse_repo_username=None, dse_repo_password=None, dse_source_build_artifactory_url=None,
               dse_source_build_artifactory_username=None, dse_source_build_artifactory_password=None,
               dse_source_build_oauth_token=None):

    enable_dse_script = """
    import json
    from cstar_perf.tool.cluster_config import cluster_config_file, config
    config['dse_url'] = '{url}'
    username = '{username}'
    pw = '{pw}'
    dse_source_build_artifactory_url = '{dse_source_build_artifactory_url}'
    dse_source_build_artifactory_username = '{dse_source_build_artifactory_username}'
    dse_source_build_artifactory_password = '{dse_source_build_artifactory_password}'
    dse_source_build_oauth_token = '{dse_source_build_oauth_token}'

    if username:
        config['dse_username'] = username
    elif 'dse_username' in config:
        del config['dse_username']

    if pw:
        config['dse_password'] = pw
    elif 'dse_password' in config:
        del config['dse_password']

    if dse_source_build_artifactory_url:
        config['dse_source_build_artifactory_url'] = dse_source_build_artifactory_url
    elif 'dse_source_build_artifactory_url' in config:
        del config['dse_source_build_artifactory_url']

    if dse_source_build_artifactory_username:
        config['dse_source_build_artifactory_username'] = dse_source_build_artifactory_username
    elif 'dse_source_build_artifactory_username' in config:
        del config['dse_source_build_artifactory_username']

    if dse_source_build_artifactory_password:
        config['dse_source_build_artifactory_password'] = dse_source_build_artifactory_password
    elif 'dse_source_build_artifactory_password' in config:
        del config['dse_source_build_artifactory_password']

    if dse_source_build_oauth_token:
        config['dse_source_build_oauth_token'] = dse_source_build_oauth_token
    elif 'dse_source_build_oauth_token' in config:
        del config['dse_source_build_oauth_token']

    with open(cluster_config_file, 'w') as f:
        f.write(json.dumps(config, sort_keys=True, indent=4, separators=(',', ': ')))
    """.format(url=dse_repo_url, username=dse_repo_username, pw=dse_repo_password,
               dse_source_build_artifactory_url=dse_source_build_artifactory_url,
               dse_source_build_artifactory_username=dse_source_build_artifactory_username,
               dse_source_build_artifactory_password=dse_source_build_artifactory_password,
               dse_source_build_oauth_token=dse_source_build_oauth_token)
    print run_python_script(enable_dse_script)
Enable DSE
dataset/ETHPy150Open datastax/cstar_perf/tool/cstar_perf/tool/fab_deploy.py/enable_dse