File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -327,12 +327,13 @@ let setup_export_test_vm session_id =
327327	     |  sr , None  -> debug test (Printf. sprintf " SR %s has no minimum disk size!" 
328328	    ) (List. combine sr_names smallest);
329329  let  minimum =  List. fold_left min (1L  **  gib) (List. map (fun  x  -> Opt. default (1L  **  gib) x) smallest) in 
330-   let  possible_srs =  List. filter (fun  (sr , size ) -> size =  Some  minimum) (List. combine all_srs smallest) in 
331-   if  List. length possible_srs =  0  then  begin 
332-     failed test " Failed to find an SR which can create a VDI" 
333-     failwith " setup_export_test_vm" 
334-   end ;
335-   let  sr =  fst (List. hd possible_srs) in 
330+   let  sr = 
331+     match  List. filter (fun  (_ , size ) -> size =  Some  minimum) (List. combine all_srs smallest) with 
332+     |  (sr , _ )::_  -> sr
333+     |  []  ->
334+       failed test " Failed to find an SR which can create a VDI" 
335+       failwith " setup_export_test_vm" 
336+   in 
336337  debug test (Printf. sprintf " Using a disk size of: %Ld on SR: %s" Quicktest_storage. name_of_sr session_id sr));
337338  let  vdi =  Client.VDI. create ! rpc session_id " small" 
338339    " description" 4194304L  `user  false  false  []  []  []  []  in 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments