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