#NEWLINE# def finalize( self ) : #NEWLINE# #INDENT# 'This must be invoked once all configuration sources have been loaded. This will\n        do the final processing, setting instrumentation and result processor configuration\n        for the run And making sure that all the mandatory config has been specified.' #NEWLINE# if self . _finalized : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( not self . _agenda ) : #NEWLINE# #INDENT# raise ValueError ( 'Attempting to finalize run configuration before an agenda is loaded.' ) #NEWLINE# #UNINDENT# self . _finalize_config_list ( 'instrumentation' ) #NEWLINE# self . _finalize_config_list ( 'result_processors' ) #NEWLINE# if ( not self . device ) : #NEWLINE# #INDENT# raise ConfigError ( 'Device not specified in the config.' ) #NEWLINE# #UNINDENT# self . _finalize_device_config ( ) #NEWLINE# if ( not self . reboot_policy . reboot_on_each_spec ) : #NEWLINE# #INDENT# for spec in self . workload_specs : #NEWLINE# #INDENT# if spec . boot_parameters : #NEWLINE# #INDENT# message = 'spec {} specifies boot_parameters; reboot policy must be at least "each_spec"' #NEWLINE# raise ConfigError ( message . format ( spec . id ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for spec in self . workload_specs : #NEWLINE# #INDENT# for globinst in self . _global_instrumentation : #NEWLINE# #INDENT# if ( self not in spec . instrumentation ) : #NEWLINE# #INDENT# spec . instrumentation . append ( globinst ) #NEWLINE# #UNINDENT# #UNINDENT# spec . validate ( ) #NEWLINE# #UNINDENT# self . _finalized = True