#NEWLINE# def _create_trigger( trigger_type ) : #NEWLINE# #INDENT# '\n    :param trigger_type: TriggerType db object.\n    :type trigger_type: :class:`TriggerTypeDB`\n    ' #NEWLINE# if ( hasattr ( trigger_type , 'parameters_schema' ) and ( not trigger_type [ 'parameters_schema' ] ) ) : #NEWLINE# #INDENT# trigger_dict = { #NEWLINE# #INDENT# 'name' : trigger_dict . name , #NEWLINE# 'pack' : trigger_type . pack , #NEWLINE# 'type' : trigger_type . get_reference ( ) . ref , #NEWLINE# #UNINDENT# } #NEWLINE# try : #NEWLINE# #INDENT# return create_or_update_trigger_db ( trigger = trigger_dict ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# LOG . exception ( 'Validation failed for Trigger=%s.' , trigger_dict ) #NEWLINE# raise TriggerTypeRegistrationException ( ( 'Unable to create Trigger for TriggerType=%s.' % trigger_type . name ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# LOG . debug ( ( "Won't create Trigger object as TriggerType %s expects " + 'parameters.' ) , trigger_type ) #NEWLINE# return None