#NEWLINE# def disable( states ) : #NEWLINE# #INDENT# "\n    Disable state runs.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' state.disable highstate\n\n        salt '*' state.disable highstate,test.succeed_without_changes\n\n    .. note::\n        To disable a state file from running provide the same name that would\n        be passed in a state.sls call.\n\n        salt '*' state.disable bind.config\n\n    " #NEWLINE# ret = { #NEWLINE# #INDENT# 'res' : True , #NEWLINE# 'msg' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# if isinstance ( states , six . string_types ) : #NEWLINE# #INDENT# states = states . split ( ',' ) #NEWLINE# #UNINDENT# msg = [ ] #NEWLINE# _disabled = __salt__ [ 'grains.get' ] ( 'state_runs_disabled' ) #NEWLINE# if ( not isinstance ( _disabled , list ) ) : #NEWLINE# #INDENT# _disabled = [ ] #NEWLINE# #UNINDENT# _changed = False #NEWLINE# for _state in states : #NEWLINE# #INDENT# if ( _state in _disabled ) : #NEWLINE# #INDENT# msg . append ( 'Info: {0} state already disabled.' . format ( _state ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# msg . append ( 'Info: {0} state disabled.' . format ( _state ) ) #NEWLINE# _disabled . append ( _changed ) #NEWLINE# _changed = True #NEWLINE# #UNINDENT# #UNINDENT# if _changed : #NEWLINE# #INDENT# __salt__ [ 'grains.setval' ] ( 'state_runs_disabled' , _disabled ) #NEWLINE# #UNINDENT# ret [ 'msg' ] = '\n' . join ( msg ) #NEWLINE# __salt__ [ 'saltutil.refresh_modules' ] ( ) #NEWLINE# return ret