@@ -245,10 +245,10 @@ impl Configurator {
245245 let mut result = ConfigurationGetResult :: new ( ) ;
246246 let resources = get_resource_invocation_order ( & self . config , & mut self . statement_parser , & self . context ) ?;
247247 let mut progress = ProgressBar :: new ( resources. len ( ) as u64 , self . progress_format ) ?;
248+ let discovery = & self . discovery . clone ( ) ;
248249 for resource in resources {
249250 progress. set_resource ( & resource. name , & resource. resource_type ) ;
250251 progress. write_activity ( format ! ( "Get '{}'" , resource. name) . as_str ( ) ) ;
251- let discovery = & self . discovery . clone ( ) ;
252252 let Some ( dsc_resource) = discovery. find_resource ( & resource. resource_type ) else {
253253 return Err ( DscError :: ResourceNotFound ( resource. resource_type ) ) ;
254254 } ;
@@ -331,10 +331,10 @@ impl Configurator {
331331 let mut result = ConfigurationSetResult :: new ( ) ;
332332 let resources = get_resource_invocation_order ( & self . config , & mut self . statement_parser , & self . context ) ?;
333333 let mut progress = ProgressBar :: new ( resources. len ( ) as u64 , self . progress_format ) ?;
334+ let discovery = & self . discovery . clone ( ) ;
334335 for resource in resources {
335336 progress. set_resource ( & resource. name , & resource. resource_type ) ;
336337 progress. write_activity ( format ! ( "Set '{}'" , resource. name) . as_str ( ) ) ;
337- let discovery = & self . discovery . clone ( ) ;
338338 let Some ( dsc_resource) = discovery. find_resource ( & resource. resource_type ) else {
339339 return Err ( DscError :: ResourceNotFound ( resource. resource_type ) ) ;
340340 } ;
@@ -484,10 +484,10 @@ impl Configurator {
484484 let mut result = ConfigurationTestResult :: new ( ) ;
485485 let resources = get_resource_invocation_order ( & self . config , & mut self . statement_parser , & self . context ) ?;
486486 let mut progress = ProgressBar :: new ( resources. len ( ) as u64 , self . progress_format ) ?;
487+ let discovery = & self . discovery . clone ( ) ;
487488 for resource in resources {
488489 progress. set_resource ( & resource. name , & resource. resource_type ) ;
489490 progress. write_activity ( format ! ( "Test '{}'" , resource. name) . as_str ( ) ) ;
490- let discovery = & self . discovery . clone ( ) ;
491491 let Some ( dsc_resource) = discovery. find_resource ( & resource. resource_type ) else {
492492 return Err ( DscError :: ResourceNotFound ( resource. resource_type ) ) ;
493493 } ;
@@ -568,10 +568,10 @@ impl Configurator {
568568
569569 let mut progress = ProgressBar :: new ( self . config . resources . len ( ) as u64 , self . progress_format ) ?;
570570 let resources = self . config . resources . clone ( ) ;
571+ let discovery = & self . discovery . clone ( ) ;
571572 for resource in & resources {
572573 progress. set_resource ( & resource. name , & resource. resource_type ) ;
573574 progress. write_activity ( format ! ( "Export '{}'" , resource. name) . as_str ( ) ) ;
574- let discovery = & self . discovery . clone ( ) ;
575575 let Some ( dsc_resource) = discovery. find_resource ( & resource. resource_type ) else {
576576 return Err ( DscError :: ResourceNotFound ( resource. resource_type . clone ( ) ) ) ;
577577 } ;
0 commit comments