Describe the bug:
get_distro() checks for /etc/mariner-release to override osinfo[0] to "mariner". On Azure Linux, this file does not exist — the distro ships /etc/azurelinux-release instead.
|
if os.path.exists("/etc/mariner-release"): |
Distro detection works correctly today because get_linux_distribution() (called earlier in the function) reads /etc/os-release (ID=azurelinux) and returns "azurelinux" before the /etc/mariner-release override is reached.
However, the dead code is a potential footgun:
- If
/etc/mariner-release is ever added to Azure Linux for backward compatibility, it would incorrectly override "azurelinux" back to "mariner" because the if block runs after get_linux_distribution().
- There is no corresponding
/etc/azurelinux-release check in the code for consistency with the other distro-specific overrides (oracle, euleros, photonos, etc.).
Current flow in get_distro():
osinfo = get_linux_distribution(0, 'alpine') # returns 'azurelinux' from os-release
...
if os.path.exists("/etc/mariner-release"): # does NOT exist on AZL — skipped
osinfo[0] = "mariner"
# No check for /etc/azurelinux-release
Steps to reproduce:
python3 -c "import azurelinuxagent.common.version as v; print(v.DISTRO_NAME)"
# azurelinux <-- works correctly today
ls /etc/*-release
# /etc/azurelinux-release /etc/os-release /etc/system-release
# No /etc/mariner-release exists
Distro and WALinuxAgent details:
- Distro and Version: Azure Linux
- WALinuxAgent version: 2.15.0.1 (waagent-2.15.0.1-1.azl4)
Additional context
This is a low-severity/informational issue. No functional impact today. Filing for awareness so the team can decide whether to:
- Add an
/etc/azurelinux-release check for consistency
- Remove the
/etc/mariner-release override entirely (since os-release handles detection)
- Leave as-is if considered harmless
Log file attached
N/A — no functional failure, detection works correctly.
Describe the bug:
get_distro()checks for/etc/mariner-releaseto overrideosinfo[0]to"mariner". On Azure Linux, this file does not exist — the distro ships/etc/azurelinux-releaseinstead.WALinuxAgent/azurelinuxagent/common/version.py
Line 137 in a976115
Distro detection works correctly today because
get_linux_distribution()(called earlier in the function) reads/etc/os-release(ID=azurelinux) and returns"azurelinux"before the/etc/mariner-releaseoverride is reached.However, the dead code is a potential footgun:
/etc/mariner-releaseis ever added to Azure Linux for backward compatibility, it would incorrectly override"azurelinux"back to"mariner"because theifblock runs afterget_linux_distribution()./etc/azurelinux-releasecheck in the code for consistency with the other distro-specific overrides (oracle, euleros, photonos, etc.).Current flow in get_distro():
Steps to reproduce:
Distro and WALinuxAgent details:
Additional context
This is a low-severity/informational issue. No functional impact today. Filing for awareness so the team can decide whether to:
/etc/azurelinux-releasecheck for consistency/etc/mariner-releaseoverride entirely (sinceos-releasehandles detection)Log file attached
N/A — no functional failure, detection works correctly.