Skip to content

Commit

Permalink
[pacemaker] Add "pcs property config" command
Browse files Browse the repository at this point in the history
Due to the deprecation of the existing "pcs property list",
this patch checks the version of pcs and executes
"pcs property config" as an alternative."

Signed-off-by: Yuki Inoguchi <[email protected]>
  • Loading branch information
Yuki Inoguchi authored and TurboTurtle committed Nov 7, 2023
1 parent ca2e293 commit 52c9237
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion sos/report/plugins/pacemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from sos.report.plugins import (Plugin, RedHatPlugin, DebianPlugin,
UbuntuPlugin, PluginOpt)
from sos.utilities import parse_version
from datetime import datetime, timedelta
import re

Expand Down Expand Up @@ -42,13 +43,23 @@ def setup_crm_shell(self):
])

def setup_pcs(self):
pcs_pkg = self.policy.package_manager.pkg_by_name('pcs')
if pcs_pkg is None:
return

self.add_copy_spec("/var/log/pcsd/pcsd.log")
self.add_cmd_output([
"pcs stonith sbd status --full",
"pcs stonith sbd watchdog list",
"pcs stonith history show",
"pcs property list --all"
])

pcs_version = '.'.join(pcs_pkg['version'])
if parse_version(pcs_version) > parse_version('0.10.8'):
self.add_cmd_output("pcs property config --all")
else:
self.add_cmd_output("pcs property list --all")

self.add_cmd_output("pcs config", tags="pcs_config")
self.add_cmd_output("pcs quorum status", tags="pcs_quorum_status")
self.add_cmd_output("pcs status --full", tags="pcs_status")
Expand Down

0 comments on commit 52c9237

Please sign in to comment.