def env_absent(name, user='root'):
 name = name.strip()
 ret = {'name': name, 'result': True, 'changes': {}, 'comment': ''}
 if __opts__['test']:
  status = _check_cron_env(user, name)
  ret['result'] = None
  if (status == 'absent'):
   ret['result'] = True
   ret['comment'] = 'Cron env {0} is absent'.format(name)
  elif ((status == 'present') or (status == 'update')):
   ret['comment'] = 'Cron env {0} is set to be removed'.format(name)
  return ret
 data = __salt__['cron.rm_env'](user, name)
 if (data == 'absent'):
  ret['comment'] = 'Cron env {0} already absent'.format(name)
  return ret
 if (data == 'removed'):
  ret['comment'] = "Cron env {0} removed from {1}'s crontab".format(name, user)
  ret['changes'] = {user: name}
  return ret
 ret['comment'] = 'Cron env {0} for user {1} failed to commit with error {2}'.format(name, user, data)
 ret['result'] = False
 return ret

def env_absent ( name , user = 'root' ) : name = name . strip ( ) ret = { 'name' : name , 'result' : True , 'changes' : { } , 'comment' : '' } if __opts__ [ 'test' ] : status = _check_cron_env ( user , name ) ret [ 'result' ] = None if ( status == 'absent' ) : ret [ 'result' ] = True ret [ 'comment' ] = 'Cron env {0} is absent' . format ( name ) elif ( ( status == 'present' ) or ( status == 'update' ) ) : ret [ 'comment' ] = 'Cron env {0} is set to be removed' . format ( name ) return ret data = __salt__ [ 'cron.rm_env' ] ( user , name ) if ( data == 'absent' ) : ret [ 'comment' ] = 'Cron env {0} already absent' . format ( name ) return ret if ( data == 'removed' ) : ret [ 'comment' ] = "Cron env {0} removed from {1}'s crontab" . format ( name , user ) ret [ 'changes' ] = { user : name } return ret ret [ 'comment' ] = 'Cron env {0} for user {1} failed to commit with error {2}' . format ( name , user , data ) ret [ 'result' ] = False return ret
verifies that the specified environment variable is absent from the crontab for the specified user name the name of the environment variable to remove from the user crontab user the name of the user whose crontab needs to be modified .