pytest-testinfra icon indicating copy to clipboard operation
pytest-testinfra copied to clipboard

_get_linux_sysinfo() will raise KeyError if lsb_release -a returns with rc != 0

Open ondrno opened this issue 2 years ago • 0 comments

affected version: 7.0.0

            # Arch doesn't have releases
>           if sysinfo["distribution"] == "arch":
E           KeyError: 'distribution'

venv/lib/python3.8/site-packages/testinfra/modules/systeminfo.py:82: KeyError

This line 82 should be changed to:

if "distribution" in sysinfo and sysinfo["distribution"] == "arch":

I will open a PR for that.

ondrno avatar Feb 26 '23 00:02 ondrno