Best-effort read of cgroup metadata for container detection.
()
| 29 | |
| 30 | |
| 31 | def _read_cgroup_content() -> str: |
| 32 | """Best-effort read of cgroup metadata for container detection.""" |
| 33 | |
| 34 | for candidate in ("/proc/1/cgroup", "/proc/self/cgroup"): |
| 35 | try: |
| 36 | return Path(candidate).read_text(encoding="utf-8") |
| 37 | except OSError: |
| 38 | continue |
| 39 | return "" |
| 40 | |
| 41 | |
| 42 | def detect_runtime_environment( |
no outgoing calls
no test coverage detected