mirror of
https://github.com/chatmail/relay.git
synced 2026-05-18 06:28:57 +00:00
generalize remotelog to "remote" and offer remote.iter_output method
This commit is contained in:
@@ -182,15 +182,15 @@ def cmfactory(request, gencreds, tmpdir, data, maildomain):
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def remotelog(sshdomain):
|
||||
return RemoteLog(sshdomain)
|
||||
def remote(sshdomain):
|
||||
return Remote(sshdomain)
|
||||
|
||||
|
||||
class RemoteLog:
|
||||
class Remote:
|
||||
def __init__(self, sshdomain):
|
||||
self.sshdomain = sshdomain
|
||||
|
||||
def iter(self, logcmd=""):
|
||||
def iter_output(self, logcmd=""):
|
||||
getjournal = f"journalctl -f" if not logcmd else logcmd
|
||||
self.popen = subprocess.Popen(
|
||||
["ssh", f"root@{self.sshdomain}", getjournal],
|
||||
|
||||
Reference in New Issue
Block a user