def parse_agent_args(args):
    """ Parse the arguments for an agent.
        (str) -> { str : str }
    """
    if not args:
        return {}
    pieces = args.split(',')
    opts = {}
    for p in pieces:
        if '=' in p:
            key, val = p.split('=')
        else:
            key, val = p, 1
        opts[key] = val
    return opts