<s> '''<STR_LIT>''' <EOL> def __virtual__ ( ) : <EOL> '''<STR_LIT>''' <EOL> return '<STR_LIT>' if '<STR_LIT>' in __salt__ else False <EOL> def present ( name , <EOL> protocol = None , <EOL> service_address = None , <EOL> server_address = None , <EOL> packet_forward_method = '<STR_LIT>' , <EOL> weight = <NUM_LIT:1> <EOL> ) : <EOL> '''<STR_LIT>''' <EOL> ret = { '<STR_LIT:name>' : name , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT:result>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> server_check = __salt__ [ '<STR_LIT>' ] ( protocol = protocol , <EOL> service_address = service_address , <EOL> server_address = server_address ) <EOL> if server_check is True : <EOL> server_rule_check = __salt__ [ '<STR_LIT>' ] ( protocol = protocol , <EOL> service_address = service_address , <EOL> server_address = server_address , <EOL> packet_forward_method = packet_forward_method , <EOL> weight = weight ) <EOL> if server_rule_check is True : <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol ) <EOL> return ret <EOL> else : <EOL> if __opts__ [ '<STR_LIT:test>' ] : <EOL> ret [ '<STR_LIT:result>' ] = None <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol ) <EOL> return ret <EOL> else : <EOL> server_edit = __salt__ [ '<STR_LIT>' ] ( protocol = protocol , <EOL> service_address = service_address , <EOL> server_address = server_address , <EOL> packet_forward_method = packet_forward_method , <EOL> weight = weight ) <EOL> if server_edit is True : <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol ) <EOL> ret [ '<STR_LIT>' ] [ name ] = '<STR_LIT>' <EOL> return ret <EOL> else : <EOL> ret [ '<STR_LIT:result>' ] = False <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol , server_edit ) <EOL> return ret <EOL> else : <EOL> if __opts__ [ '<STR_LIT:test>' ] : <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol ) <EOL> ret [ '<STR_LIT:result>' ] = None <EOL> return ret <EOL> else : <EOL> server_add = __salt__ [ '<STR_LIT>' ] ( protocol = protocol , <EOL> service_address = service_address , <EOL> server_address = server_address , <EOL> packet_forward_method = packet_forward_method , <EOL> weight = weight ) <EOL> if server_add is True : <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol ) <EOL> ret [ '<STR_LIT>' ] [ name ] = '<STR_LIT>' <EOL> return ret <EOL> else : <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol , server_add ) <EOL> ret [ '<STR_LIT:result>' ] = False <EOL> return ret <EOL> def absent ( name , protocol = None , service_address = None , server_address = None ) : <EOL> '''<STR_LIT>''' <EOL> ret = { '<STR_LIT:name>' : name , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT:result>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> server_check = __salt__ [ '<STR_LIT>' ] ( protocol = protocol , <EOL> service_address = service_address , <EOL> server_address = server_address ) <EOL> if server_check is True : <EOL> if __opts__ [ '<STR_LIT:test>' ] : <EOL> ret [ '<STR_LIT:result>' ] = None <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol ) <EOL> return ret <EOL> server_delete = __salt__ [ '<STR_LIT>' ] ( protocol = protocol , <EOL> service_address = service_address , <EOL> server_address = server_address ) <EOL> if server_delete is True : <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol ) <EOL> ret [ '<STR_LIT>' ] [ name ] = '<STR_LIT>' <EOL> return ret <EOL> else : <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol , server_delete ) <EOL> ret [ '<STR_LIT:result>' ] = False <EOL> return ret <EOL> else : <EOL> ret [ '<STR_LIT>' ] = '<STR_LIT>' . format ( name , service_address , protocol ) <EOL> return ret </s>
