def kvp_string_to_rec(string):
    """Take an input string 'a=b,c=d,e=f' and return the record
    {'a':'b','c':'d','e':'f'}"""
    rec = {}
    for kvp in string.split(','):
        arr = kvp.split('=')
        if len(arr) > 2:
            raise Exception("Cannot convert %s to KVP" % string)
        rec[arr[0]] = arr[1]
    return rec