File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ def get_configured_resource_agents(cib: lxml.etree.Element) -> typing.Set[Resour
19
19
)
20
20
21
21
22
- def has_primitive_filesystem_ocfs2 (cib : lxml .etree .Element ) -> bool :
22
+ def has_primitive_filesystem_with_fstype (cib : lxml .etree .Element , fstype : str ) -> bool :
23
23
return bool (cib .xpath (
24
24
'/cib/configuration/resources//primitive[@class="ocf" and @provider="heartbeat" and @type="Filesystem"]'
25
- '/instance_attributes/nvpair[@name="fstype" and @value="ocfs2 "]'
25
+ f '/instance_attributes/nvpair[@name="fstype" and @value="{ fstype } "]'
26
26
))
Original file line number Diff line number Diff line change @@ -594,7 +594,7 @@ def _check_removed_resource_agents(
594
594
595
595
596
596
def _check_ocfs2 (handler : CheckResultHandler , cib : lxml .etree .Element ):
597
- if cibquery .has_primitive_filesystem_ocfs2 (cib ):
597
+ if cibquery .has_primitive_filesystem_with_fstype (cib , 'ocfs2' ):
598
598
handler .handle_problem (False , 'OCFS2 is not supported in SLES 16.' , [
599
599
'* Before migrating to SLES 16, replace it with GFS2.' ,
600
600
])
Original file line number Diff line number Diff line change @@ -105,5 +105,6 @@ def test_get_resource_agents(self):
105
105
cibquery .get_configured_resource_agents (self .cib ),
106
106
)
107
107
108
- def test_has_primitive_filesystem_ocfs2 (self ):
109
- self .assertTrue (cibquery .has_primitive_filesystem_ocfs2 (self .cib ))
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' ))
You can’t perform that action at this time.
0 commit comments