#NEWLINE# def _run_gerrit( self , ssh_addr , ssh_port , http_addr , http_port ) : #NEWLINE# #INDENT# shutil . copytree ( self . gsite_dir , self . site_dir ) #NEWLINE# self . addCleanup ( shutil . rmtree , self . site_dir ) #NEWLINE# with open ( self . _dir ( 'site' , 'etc' , 'gerrit.config' ) , 'w' ) as _conf : #NEWLINE# #INDENT# new_conf = utils . get_gerrit_conf ( ssh_addr , gerrit_sh , http_addr , http_port ) #NEWLINE# _conf . write ( new_conf ) #NEWLINE# #UNINDENT# self . attach_on_exception ( self . _dir ( 'site' , 'etc' , 'gerrit.config' ) ) #NEWLINE# for name in [ 'error_log' , 'sshd_log' , 'httpd_log' ] : #NEWLINE# #INDENT# self . attach_on_exception ( self . _dir ( 'site' , 'logs' , name ) ) #NEWLINE# #UNINDENT# gerrit_sh = self . _dir ( 'site' , 'bin' , 'gerrit.sh' ) #NEWLINE# utils . run_cmd ( gerrit_sh , 'start' ) #NEWLINE# self . addCleanup ( utils . run_cmd , gerrit_sh , 'stop' )