Skip to content

Commit

Permalink
do not reload or restart if corosync.service is not running
Browse files Browse the repository at this point in the history
Co-authored-by: Roger Zhou <[email protected]>
  • Loading branch information
nicholasyang2022 and zzhou1 authored Aug 2, 2024
1 parent 2dcb688 commit 6b19adc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crmsh/ui_corosync.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ def __save_changed_config(linkmanager, dom, reload: bool):
logger.info('Synchronizing corosync.conf in the cluster...')
if not corosync.push_configuration(nodes):
raise ValueError('Failed to synchronize corosync.conf in the cluster.')

if not ServiceManager(sh.ClusterShellAdaptorForLocalShell(sh.LocalShell())).service_is_active("corosync.service"):
return

if reload:
result = subprocess.run(['corosync-cfgtool', '-R'])
if 0 != result.returncode:
Expand Down

0 comments on commit 6b19adc

Please sign in to comment.