Updates ret iff there was a failure or in test mode.

def _add_global_secondary_index(ret, name, index_name, changes_old, changes_new, comments,
                                gsi_config, region, key, keyid, profile):
    '''Updates ret iff there was a failure or in test mode.'''
    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Dynamo table {0} will have a GSI added: {1}'.format(
            name, index_name)
        return
    changes_new.setdefault('global_indexes', {})
    success = __salt__['boto_dynamodb.create_global_secondary_index'](
        name,
        __salt__['boto_dynamodb.extract_index'](
            gsi_config[index_name], global_index=True),
        region=region,
        key=key,
        keyid=keyid,
        profile=profile,
    )

    if success:
        comments.append('Created GSI {0}'.format(index_name))
        changes_new['global_indexes'][index_name] = gsi_config[index_name]
    else:
        ret['result'] = False
        ret['comment'] = 'Failed to create GSI {0}'.format(index_name)