def env_present(name,
                value=None,
                user='root'):
    ret = {'changes': {},
           'comment': '',
           'name': name,
           'result': True}
    if __opts__['test']:
        status = _check_cron_env(user, name, value=value)
        ret['result'] = None
        if status == 'absent':
            ret['comment'] = 'Cron env {0} is set to be added'.format(name)
        elif status == 'present':
            ret['result'] = True
            ret['comment'] = 'Cron env {0} already present'.format(name)
        elif status == 'update':
            ret['comment'] = 'Cron env {0} is set to be updated'.format(name)
        return ret

    data = __salt__['cron.set_env'](user, name, value=value)
    if data == 'present':
        ret['comment'] = 'Cron env {0} already present'.format(name)
        return ret

    if data == 'new':
        ret['comment'] = 'Cron env {0} added to {1}\'s crontab'.format(name, user)
        ret['changes'] = {user: name}
        return ret

    if data == 'updated':
        ret['comment'] = 'Cron env {0} updated'.format(name)
        ret['changes'] = {user: name}
        return ret
    ret['comment'] = ('Cron env {0} for user {1} failed to commit with error \n{2}'
                      .format(name, user, data))
    ret['result'] = False
    return ret
Append to multiple tables
dataset/ETHPy150Open saltstack/salt/salt/states/cron.py/env_present--crossover with--dataset/ETHPy150Open pydata/pandas/pandas/io/pytables.py/HDFStore.append_to_multiple