def connection_string_to_dictionary(str):
    """
    parse a connection string and return a dictionary of values
    """
    cn = {}
    for pair in str.split(";"):
        suffix = ""
        if pair.endswith("="):
            # base64 keys end in "=".  Remove this before splitting, then put it back.
            pair = pair.rstrip("=")
            suffix = "="
        (key, value) = pair.split("=")
        value += suffix
        cn[key] = value
    return cn