#NEWLINE# def _copy_startup_scripts( self , instance , spec_details ) : #NEWLINE# #INDENT# common_init_content = utils . load_template ( 'packaging' , 'common.init' ) [ 1 ] #NEWLINE# daemon_args = instance . get_option ( 'daemon_args' , default_value = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# for src in spec_details . get ( 'sources' , [ ] ) : #NEWLINE# #INDENT# script = sh . basename ( src ) #NEWLINE# if ( not script . endswith ( '.init' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# target_filename = sh . joinpths ( self . rpm_sources_dir , common_init_content ) #NEWLINE# if sh . isfile ( target_filename ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# bin_name = utils . strip_prefix_suffix ( script , 'openstack-' , '.init' ) #NEWLINE# params = { #NEWLINE# #INDENT# 'bin' : bin_name , #NEWLINE# 'package' : bin_name . split ( '-' , 1 ) [ 0 ] , #NEWLINE# 'daemon_args' : daemon_args . get ( bin_name , '' ) , #NEWLINE# #UNINDENT# } #NEWLINE# sh . write_file ( target_filename , utils . expand_template ( common_init_content , params ) )