#NEWLINE# def add_goal_state( data ) : #NEWLINE# #INDENT# goal_sid = __opts__ [ 'stateconf_goal_state' ] #NEWLINE# if ( goal_sid in data ) : #NEWLINE# #INDENT# raise SaltRenderError ( "Can't generate goal state({0})! The same state id already exists!" . format ( goal_sid ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# reqlist = [ ] #NEWLINE# for ( sid , states , state , _ ) in statelist ( data , set ( [ 'include' , 'exclude' , 'extend' ] ) ) : #NEWLINE# #INDENT# if ( '__sls__' in states ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# reqlist . append ( { #NEWLINE# #INDENT# state_name ( state ) : sid , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# data [ goal_sid ] = { #NEWLINE# #INDENT# STATE_FUNC : [ dict ( require = reqlist ) ] , #NEWLINE# #UNINDENT# }