#NEWLINE# def _build_openstack_package( self , instance ) : #NEWLINE# #INDENT# params = self . _package_parameters ( instance ) #NEWLINE# patches = instance . list_patches ( 'package' ) #NEWLINE# params [ 'patches' ] = [ sh . basename ( fn ) for fn in patches ] #NEWLINE# build_name = instance . get_option ( 'build_name' , default_value = rpm_name . name ) #NEWLINE# ( rpm_name , template_name ) = self . _find_template_and_rpm_name ( instance , build_name ) #NEWLINE# try : #NEWLINE# #INDENT# egg_name = instance . egg_info [ 'name' ] #NEWLINE# params [ 'version' ] = instance . egg_info [ 'version' ] #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if any ( ( s . endswith ( 'client' ) for s in ( instance . name , egg_name , build_name ) ) ) : #NEWLINE# #INDENT# client_name = utils . strip_prefix_suffix ( egg_name , 'python-' , 'client' ) #NEWLINE# if ( not client_name ) : #NEWLINE# #INDENT# msg = ( 'Bad client package name %s' % egg_name ) #NEWLINE# raise excp . PackageException ( msg ) #NEWLINE# #UNINDENT# params [ 'clientname' ] = client_name #NEWLINE# params [ 'apiname' ] = instance . get_option ( 'api_name' , default_value = client_name . title ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# if all ( ( rpm_name , template_name ) ) : #NEWLINE# #INDENT# spec_filename = self . _write_spec_file ( instance , rpm_name , template_name , params ) #NEWLINE# self . _build_from_spec ( instance , spec_filename , patches ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . py2rpm_helper . build_srpm ( source = instance . get_option ( 'app_dir' ) , log_filename = instance . name , release = params . get ( 'release' ) , with_tests = ( not params . get ( 'no_tests' ) ) )