File tree Expand file tree Collapse file tree 3 files changed +2
-13
lines changed Expand file tree Collapse file tree 3 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,6 @@ def get_configured_resource_agents(cib: lxml.etree.Element) -> typing.Set[Resour
1818    )
1919
2020
21- def  has_primitive_filesystem_with_fstype (cib : lxml .etree .Element , fstype : str ) ->  bool :
22-     return  bool (cib .xpath (
23-         '/cib/configuration/resources//primitive[@class="ocf" and @provider="heartbeat" and @type="Filesystem"]' 
24-         f'/instance_attributes/nvpair[@name="fstype" and @value="{ fstype }  "]' 
25-     ))
26- 
27- 
2821class  PrimitiveFilesystemQuery :
2922    PRIMITIVE_XPATH  =  '/cib/configuration/resources//primitive[@class="ocf" and @provider="heartbeat" and @type="Filesystem"]' 
3023
Original file line number Diff line number Diff line change @@ -428,7 +428,7 @@ def _check_removed_resource_agents(
428428
429429
430430def  _check_ocfs2 (handler : CheckResultHandler , cib : lxml .etree .Element ):
431-     if  cibquery .has_primitive_filesystem_with_fstype (cib ,  'ocfs2' ):
431+     if  cibquery .PrimitiveFilesystemQuery (cib ). fstype ( 'ocfs2' ). exists ( ):
432432       handler .handle_problem (False , 'OCFS2 is not supported in SLES 16. Please use GFS2.' , [
433433       ])
434434
Original file line number Diff line number Diff line change @@ -105,10 +105,6 @@ def test_get_resource_agents(self):
105105            cibquery .get_configured_resource_agents (self .cib ),
106106        )
107107
108-     def  test_has_primitive_filesystem_with_fstype (self ):
109-         self .assertTrue (cibquery .has_primitive_filesystem_with_fstype (self .cib , 'ocfs2' ))
110-         self .assertFalse (cibquery .has_primitive_filesystem_with_fstype (self .cib , 'foo' ))
111- 
112108
113109class  TestPrimitiveFilesystemQuery (unittest .TestCase ):
114110    def  setUp (self ) ->  None :
@@ -141,4 +137,4 @@ def test_exists_directory_no_match(self):
141137
142138    def  test_exists_fstype_and_directory_match (self ):
143139        query  =  cibquery .PrimitiveFilesystemQuery (self .cib )
144-         self .assertTrue (query .fstype ('ocfs2' ).directory ('/srv/clusterfs' ).exists ())
140+         self .assertTrue (query .fstype ('ocfs2' ).directory ('/srv/clusterfs' ).exists ())
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments