コード例 #1
0
 def fixture_call_sbd_message(
     self, device, node, message, stderr="", return_code=0
 ):
     return [Call(
         "sbd -d {0} message {1} {2}".format(device, node, message),
         stderr=stderr,
         returncode=return_code
     )]
コード例 #2
0
    def fixture_sbd_init(
        self, device_list, options, stdout="", stderr="", return_code=0
    ):
        cmd = ["sbd"]
        for device in device_list:
            cmd += ["-d", device]

        for opt, val in options:
            cmd += [opt, val]

        cmd.append("create")
        return [Call(" ".join(cmd), stdout, stderr, return_code)]
コード例 #3
0
 def fixture_sbd_dump(self, device, stdout="", return_code=0):
     cmd = ["sbd", "-d", device, "dump"]
     return [Call(" ".join(cmd), stdout, returncode=return_code)]
コード例 #4
0
 def fixture_sbd_enabled(self, enabled):
     cmd = [settings.systemctl_binary, "is-enabled", "sbd.service"]
     return [Call(" ".join(cmd), returncode=0 if enabled else 1)]