Exemple #1
0
def get_status(env):
    name = env.booth.name
    return {
        "status": status.get_daemon_status(env.cmd_runner(), name),
        "ticket": status.get_tickets_status(env.cmd_runner(), name),
        "peers": status.get_peers_status(env.cmd_runner(), name),
    }
Exemple #2
0
def get_status(env):
    name = env.booth.name
    return {
        "status": status.get_daemon_status(env.cmd_runner(), name),
        "ticket": status.get_tickets_status(env.cmd_runner(), name),
        "peers": status.get_peers_status(env.cmd_runner(), name),
    }
Exemple #3
0
 def test_failure(self):
     self.mock_run.run.return_value = ("out", "error", 1)
     assert_raise_library_error(
         lambda: lib.get_peers_status(self.mock_run),
         (Severities.ERROR, report_codes.BOOTH_PEERS_STATUS_ERROR, {
             "reason": "error\nout"
         }))
     self.mock_run.run.assert_called_once_with(
         [settings.booth_binary, "peers"])
Exemple #4
0
def get_status(env: LibraryEnvironment, instance_name=None):
    """
    get booth status info

    env
    string instance_name -- booth instance name
    """
    booth_env = env.get_booth_env(instance_name)
    _ensure_live_env(env, booth_env)
    instance_name = booth_env.instance_name
    return {
        "status": status.get_daemon_status(env.cmd_runner(), instance_name),
        "ticket": status.get_tickets_status(env.cmd_runner(), instance_name),
        "peers": status.get_peers_status(env.cmd_runner(), instance_name),
    }
Exemple #5
0
 def test_failure(self):
     self.mock_run.run.return_value = ("out", "error", 1)
     assert_raise_library_error(
         lambda: lib.get_peers_status(self.mock_run),
         (
             Severities.ERROR,
             report_codes.BOOTH_PEERS_STATUS_ERROR,
             {
                 "reason": "error\nout"
             }
         )
     )
     self.mock_run.run.assert_called_once_with(
         [settings.booth_binary, "peers"]
     )
Exemple #6
0
 def test_with_name(self):
     self.mock_run.run.return_value = ("output", "", 0)
     self.assertEqual("output", lib.get_peers_status(self.mock_run, "name"))
     self.mock_run.run.assert_called_once_with(
         [settings.booth_binary, "peers", "-c", "name"]
     )
Exemple #7
0
 def test_with_name(self):
     self.mock_run.run.return_value = ("output", "", 0)
     self.assertEqual("output", lib.get_peers_status(self.mock_run, "name"))
     self.mock_run.run.assert_called_once_with(
         [settings.booth_binary, "peers", "-c", "name"]
     )
Exemple #8
0
def get_status(env, name=None):
    return {
        "status": status.get_daemon_status(env.cmd_runner(), name),
        "ticket": status.get_tickets_status(env.cmd_runner(), name),
        "peers": status.get_peers_status(env.cmd_runner(), name),
    }
Exemple #9
0
def get_status(env, name=None):
    return {
        "status": status.get_daemon_status(env.cmd_runner(), name),
        "ticket": status.get_tickets_status(env.cmd_runner(), name),
        "peers": status.get_peers_status(env.cmd_runner(), name),
    }