#NEWLINE# @ utils . retry #NEWLINE# def _remove_cloned_repo( self , destination ) : #NEWLINE# #INDENT# if ( not os . path . exists ( destination ) ) : #NEWLINE# #INDENT# return 0 #NEWLINE# #UNINDENT# result = 1 #NEWLINE# try : #NEWLINE# #INDENT# ct = self . docker . create_container ( image = self . cloner_image , user = str ( self . docker_cmd_uid ) , command = [ 'rm' , '-rf' , '/tmp/code' ] ) #NEWLINE# self . docker . start ( container = ct . get ( 'Id' ) , binds = { #NEWLINE# #INDENT# destination : '/tmp' , #NEWLINE# #UNINDENT# } ) #NEWLINE# result = self . docker . wait ( container = ct . get ( 'Id' ) ) #NEWLINE# self . docker . remove_container ( container = ct . get ( 'Id' ) ) #NEWLINE# #UNINDENT# except ( errors . DockerException , errors . APIError ) as e : #NEWLINE# #INDENT# clone_dir = '{}/code' . format ( destination ) #NEWLINE# LOG . error ( ( 'Error in remove cloned repo %s, %s' % ( clone_dir , str ( e ) ) ) ) #NEWLINE# #UNINDENT# return self