Skip to content

Commit 4a694b7

Browse files
authored
Dev: ra: Guess stonith class type when using fence agents (#1463)
## Problem When adding fence agent without giving `stonith` class, get an error while using Tab to get parameters ``` crm(live/alp-1)configure# primitive stonith-sbd fence_sbd params ERROR: ocf:heartbeat:fence_sbd: got no meta-data, does this RA exist? ``` That is allowed when adding ocf RA without giving `ocf` class ``` crm(live/alp-1)configure# primitive d Dummy params fake= state= ``` ## Solution In ra.disambiguate_ra_type function, return 'stonith' class type when RA starts with 'fence_'
2 parents 5ab3a5d + e9f9d42 commit 4a694b7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crmsh/ra.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,10 @@ def disambiguate_ra_type(s):
865865
elif len(l) == 2:
866866
cl, tp = l
867867
else:
868-
cl, tp = "ocf", l[0]
868+
if l[0].startswith("fence_"):
869+
cl, tp = "stonith", l[0]
870+
else:
871+
cl, tp = "ocf", l[0]
869872
pr = pick_provider(ra_providers(tp, cl)) if cl == 'ocf' else ''
870873
return cl, pr, tp
871874

0 commit comments

Comments
 (0)