def METHOD_NAME(old_tasks, new_tasks):
    "Update tasks dictionaries"
    for task, tval in viewitems(new_tasks):
        if task in old_tasks:
            for site, sval in viewitems(tval['sites']):
                if site in old_tasks[task]['sites']:
                    old_sdict = old_tasks[task]['sites'][site]
                    new_sdict = sval
                    status = merge_docs(old_sdict, new_sdict)
                    if not status:
                        logging.error("Error merge_docs:\n%s\n%s\n", pformat(old_sdict),
                                      pformat(new_sdict))
                else:
                    old_tasks[task]['sites'].update({site: sval})
        else:
            old_tasks.update({task: tval})
    return old_tasks