# Path: crmsh/bootstrap.py
# SYSCONFIG_SBD = "/etc/sysconfig/sbd"
# 
# SBD_SYSTEMD_DELAY_START_DIR = "/etc/systemd/system/sbd.service.d"


import os
import re
import shutil
from . import utils
from . import bootstrap
from .bootstrap import SYSCONFIG_SBD, SBD_SYSTEMD_DELAY_START_DIR
from . import log
from . import constants
from . import corosync
from . import xmlutil
        from .watchdog import Watchdog
        from .watchdog import Watchdog
        For disk-based-sbd, also calculate the msgwait value, then initialize the SBD device.
        """
        msg = ""
        if self.diskless_sbd:
            msg = "Configuring diskless SBD"
        elif not self.no_overwrite:
            msg = "Initializing SBD"
        if msg:
            logger.info(msg)
        self.timeout_inst = SBDTimeout(self._context)
        self.timeout_inst.set_sbd_watchdog_timeout()
        if self.diskless_sbd:
            self.timeout_inst.adjust_sbd_watchdog_timeout_with_diskless_and_qdevice()
            return

        self.timeout_inst.set_sbd_msgwait()
        opt = "-4 {} -1 {}".format(self.timeout_inst.sbd_msgwait, self.timeout_inst.sbd_watchdog_timeout)

        for dev in self._sbd_devices:
            if self.no_overwrite and SBDManager.has_sbd_device_already_initialized(dev):
                continue
            rc, _, err = bootstrap.invoke("sbd {} -d {} create".format(opt, dev))
            if not rc:
                utils.fatal("Failed to initialize SBD device {}: {}".format(dev, err))

    def _update_sbd_configuration(self):
        """
        Update /etc/sysconfig/sbd
        """
        if self.no_overwrite:

# Path: crmsh/bootstrap.py
# SYSCONFIG_SBD = "/etc/sysconfig/sbd"
# 
# SBD_SYSTEMD_DELAY_START_DIR = "/etc/systemd/system/sbd.service.d"


# Path: crmsh/sbd.py
import os
import re
import shutil
from . import utils
from . import bootstrap
from .bootstrap import SYSCONFIG_SBD, SBD_SYSTEMD_DELAY_START_DIR
from . import log
from . import constants
from . import corosync
from . import xmlutil
        from .watchdog import Watchdog
        from .watchdog import Watchdog

        For disk-based-sbd, also calculate the msgwait value, then initialize the SBD device.
        """
        msg = ""
        if self.diskless_sbd:
            msg = "Configuring diskless SBD"
        elif not self.no_overwrite:
            msg = "Initializing SBD"
        if msg:
            logger.info(msg)
        self.timeout_inst = SBDTimeout(self._context)
        self.timeout_inst.set_sbd_watchdog_timeout()
        if self.diskless_sbd:
            self.timeout_inst.adjust_sbd_watchdog_timeout_with_diskless_and_qdevice()
            return

        self.timeout_inst.set_sbd_msgwait()
        opt = "-4 {} -1 {}".format(self.timeout_inst.sbd_msgwait, self.timeout_inst.sbd_watchdog_timeout)

        for dev in self._sbd_devices:
            if self.no_overwrite and SBDManager.has_sbd_device_already_initialized(dev):
                continue
            rc, _, err = bootstrap.invoke("sbd {} -d {} create".format(opt, dev))
            if not rc:
                utils.fatal("Failed to initialize SBD device {}: {}".format(dev, err))

    def _update_sbd_configuration(self):
        """
        Update /etc/sysconfig/sbd
        """
        if self.no_overwrite:

            bootstrap.csync2_update(SYSCONFIG_SBD)