def fix_dn(dn):
    """Fix a string DN to use ${CONFIGDN}"""

    if dn.find("<Configuration NC Distinguished Name>") != -1:
        dn = dn.replace("\n ", "")
        return dn.replace("<Configuration NC Distinguished Name>", "${CONFIGDN}")
    else:
        return dn