error bridge veth
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 9s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 9s
This commit is contained in:
@@ -13,6 +13,21 @@ from src.config import settings
|
||||
logger = logging.getLogger("capture_pipeline")
|
||||
|
||||
|
||||
def _run_checked(cmd: list[str]) -> subprocess.CompletedProcess[str]:
|
||||
"""Run a command and surface stdout/stderr in raised errors."""
|
||||
try:
|
||||
return subprocess.run(cmd, check=True, capture_output=True, text=True)
|
||||
except subprocess.CalledProcessError as exc:
|
||||
stdout = (exc.stdout or "").strip()
|
||||
stderr = (exc.stderr or "").strip()
|
||||
if stdout:
|
||||
logger.error("Command stdout for %s:\n%s", cmd[0], stdout)
|
||||
if stderr:
|
||||
logger.error("Command stderr for %s:\n%s", cmd[0], stderr)
|
||||
detail = stderr or stdout or str(exc)
|
||||
raise RuntimeError(detail) from exc
|
||||
|
||||
|
||||
class CapturePipelineManager:
|
||||
"""Reference-count mirrored capture pipelines per bridge."""
|
||||
|
||||
@@ -107,7 +122,7 @@ class CapturePipelineManager:
|
||||
mirror_if,
|
||||
capture_if,
|
||||
)
|
||||
subprocess.run(cmd, check=True, capture_output=True, text=True)
|
||||
_run_checked(cmd)
|
||||
self._active[bridge] = {
|
||||
"mirror_if": mirror_if,
|
||||
"capture_if": capture_if,
|
||||
@@ -134,7 +149,7 @@ class CapturePipelineManager:
|
||||
mirror_if,
|
||||
capture_if,
|
||||
)
|
||||
subprocess.run(cmd, check=True, capture_output=True, text=True)
|
||||
_run_checked(cmd)
|
||||
|
||||
def _repo_root(self) -> Path:
|
||||
return Path(__file__).resolve().parents[3]
|
||||
|
||||
Reference in New Issue
Block a user