#NEWLINE# def copy_files( self , exclude_files ) : #NEWLINE# #INDENT# for ( fname , template_hash ) in self . m_template . manifest [ 'files' ] . items ( ) : #NEWLINE# #INDENT# template_fname = pathfor ( self , c . TEMPLATE ) #NEWLINE# master_fname = pathfor ( fname , c . MASTER ) #NEWLINE# if ( self . m_master . manifest [ 'files' ] [ fname ] == template_hash ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( fname in exclude_files ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# _cur_role = self . role_of_fname ( fname ) #NEWLINE# if ( _cur_role and self . master_playbook_exists and ( _cur_role not in self . roles ) ) : #NEWLINE# #INDENT# debug ( 'Skipping unused role file: {0}' . format ( fname ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( fname == c . SERVIFILE_GLOBAL ) : #NEWLINE# #INDENT# master_fname = c . SERVIFILE_GLOBAL_FULL #NEWLINE# #UNINDENT# if ( ( os . path . split ( fname ) [ 1 ] == '.git' ) and os . path . isfile ( template_fname ) ) : #NEWLINE# #INDENT# debug ( 'Skipping .git file (submodule marker): {0}' . format ( fname ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# if file_exists ( master_fname ) : #NEWLINE# #INDENT# self . rename_master_file ( fname , self . timestamp ) #NEWLINE# existing = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# existing = False #NEWLINE# #UNINDENT# destdir = os . path . dirname ( master_fname ) #NEWLINE# if ( destdir and ( not os . path . exists ( destdir ) ) ) : #NEWLINE# #INDENT# os . makedirs ( destdir ) #NEWLINE# #UNINDENT# shutil . copy2 ( template_fname , master_fname ) #NEWLINE# if existing : #NEWLINE# #INDENT# debug ( 'Updated: {0}' . format ( master_fname ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# debug ( 'Created: {0}' . format ( master_fname ) ) #NEWLINE# #UNINDENT# #UNINDENT# m = Manifest ( c . MASTER ) #NEWLINE# m . save ( ) #NEWLINE# self . update_tmgr ( ) #NEWLINE# return True