#NEWLINE# def _deployment_get( self , deployment , session = None ) : #NEWLINE# #INDENT# stored_deployment = self . model_query ( models . Deployment , session = session ) . filter_by ( name = deployment ) . first ( ) #NEWLINE# if ( not stored_deployment ) : #NEWLINE# #INDENT# stored_deployment = self . model_query ( models . Deployment , session = session ) . filter_by ( uuid = deployment ) . first ( ) #NEWLINE# #UNINDENT# if ( not stored_deployment ) : #NEWLINE# #INDENT# raise exceptions . DeploymentNotFound ( deployment = deployment ) #NEWLINE# #UNINDENT# return stored_deployment