#NEWLINE# def _run( self ) : #NEWLINE# #INDENT# self . o . reset ( ) #NEWLINE# error = None #NEWLINE# try : #NEWLINE# #INDENT# result = self . _create_and_start_container ( ) #NEWLINE# if ( result is None ) : #NEWLINE# #INDENT# self . o . commit ( blue ( 'up{}' . format ( time_ago ( self . container . started_at ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if result : #NEWLINE# #INDENT# self . o . commit ( green ( 'started' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . o . commit ( red ( 'service did not start!' ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( result is False ) : #NEWLINE# #INDENT# error = [ 'Halting start sequence because {} failed to start!' . format ( self . container ) , self . container . ship . backend . logs ( result . container . id ) ] #NEWLINE# raise exceptions . ContainerOrchestrationException ( self . container , '\n' . join ( error ) . strip ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# self . o . commit ( red ( 'failed to start container!' ) ) #NEWLINE# raise