Source: factory.core/ObjPlatform.py
Platform and system environment detection.
Consolidates all platform, virtualization, and system
detection queries into a single module. All methods are
static and require no instantiation.
...
| Method | Signature | Description |
|---|---|---|
| is_aws | is_aws() -> bool |
Check if running on an AWS EC2 instance. |
| is_kvm | is_kvm() -> bool |
Check if running on KVM/Proxmox. |
| is_docker | is_docker() -> int |
Check if running in a Docker container. |
| is_kubernetes | is_kubernetes() -> int |
Check if running inside a Kubernetes pod. |
| detect_kubernetes | detect_kubernetes() -> str | None |
Detect Kubernetes pod environment. |
| detect_docker | detect_docker() -> str | None |
Detect Docker container environment. |
| is_pytest | is_pytest() -> bool |
Check if running under pytest. |
| detect_wsl | detect_wsl() -> str | None |
Detect WSL environment. |
| detect_systemd_virt | detect_systemd_virt() -> str | None |
Detect virtualization using systemd-detect-virt. |
| detect_dmi | detect_dmi() -> str | None |
Detect virtualization or physical host via DMI/SMBIOS. |
| detect_aws_metadata | detect_aws_metadata() -> str | None |
Detect AWS environment via metadata endpoint. |
| detect_lxc_cgroup | detect_lxc_cgroup() -> str | None |
Detect LXC using cgroup files or environment variables. |
| detect_vmware_mac | detect_vmware_mac() -> str | None |
Detect VMware via known MAC OUIs using psutil. |
| detect_kernel_modules | detect_kernel_modules() -> str | None |
Detect virtualization via kernel modules. |
| get_virtualization_environment | get_virtualization_environment() -> str |
Combine all detection methods in order. |
| get_mac_address | get_mac_address(interface: str = 'ens18') -> str |
Get MAC address in a cross-platform way. |
| get_ip_address | get_ip_address() -> str |
Get the local IP address. |
| get_hostname | get_hostname() -> str |
Get the system hostname. |
| get_parent_name | get_parent_name() -> str |
Get the name of the parent process. |
| is_in_multiplexer | is_in_multiplexer() -> bool |
Check if running inside tmux, screen, or byobu. |
| get_multiplexer_info | get_multiplexer_info() -> dict[str, str | bool] |
Gather multiplexer session details. |
| has_x_display | has_x_display() -> bool |
Check if an X11 display server is available. |
Display platform detection results.