def write_krb_conf()

in sagemaker_studio_sparkmagic_lib/kerberos.py [0:0]


def write_krb_conf(emr_cluster, filepath):
    """
    Writes kerberos file at give path using kerberos properties derived from emr cluster
    :param str emr_cluster: EMR cluster Id
    :param str filepath: Absolute file path to write krb5.conf file
    """
    emr_krb_conf = emr_cluster.get_krb_conf()
    logger.debug(f"emr kerb properties:{emr_krb_conf}")
    with open(filepath, "w") as f:
        krb_conf_str = generate_kerb_conf_str(emr_krb_conf)
        f.write(krb_conf_str)