Update a record.

    Argument:

        args: arguments object

    Firstly call delete(), then create().

def update(args):
    """Update a record.

    Argument:

        args: arguments object

    Firstly call delete(), then create().
    """
    # Check specifying some new values
    if ((not args.__dict__.get('new_type') and
         not args.__dict__.get('new_content') and
         not args.__dict__.get('new_ttl') and
         not args.__dict__.get('new_priority'))):
        utils.error("Not update any values.")

    args.__dict__['search'] = (args.__dict__.get('name') + ',' +
                               args.__dict__.get('rtype') + ',' +
                               args.__dict__.get('content'))

    args.__dict__['raw_flag'] = True
    data = get(args)
    if len(data.get('records')) == 1:
        cur_ttl = data.get('records')[0].get('ttl')
        cur_priority = data.get('records')[0].get('priority')
    elif len(data.get('records')) > 1:
        utils.error("Match multiple records")
    else:
        utils.error("No match records")

    new_args = copy.copy(args)

    if new_args.__dict__.get('new_type'):
        new_args.__dict__['rtype'] = new_args.__dict__.get('new_type')

    if new_args.__dict__.get('new_content'):
        new_args.__dict__['content'] = new_args.__dict__.get('new_content')

    if new_args.__dict__.get('new_ttl'):
        new_args.__dict__['ttl'] = new_args.__dict__.get('new_ttl')
    else:
        new_args.__dict__['ttl'] = cur_ttl

    if new_args.__dict__.get('new_priority'):
        new_args.__dict__['priority'] = new_args.__dict__.get('new_priority')
    else:
        if cur_priority:
            new_args.__dict__['priority'] = cur_priority

    delete(args)
    create(new_args)