Skip to content

Commit 0e6c613

Browse files
committed
Fix for distro bug: python-distro/distro#309.
1 parent 5f59df8 commit 0e6c613

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyinfra/facts/util/distro.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ def get_distro_info(root_dir):
1212

1313
obj = distro.LinuxDistribution(include_lsb=False, include_uname=False)
1414

15+
# Fixes a bug in distro: https://github.com/python-distro/distro/issues/309
16+
obj._uname_info = {}
17+
1518
# NOTE: The parsing of LinuxDistribution distro information is done in a lazy way.
1619
# This will force the parsing to happen before we restore the old value of _UNIXCONFDIR.
1720
_ = obj.info()

tests/facts/server.LinuxDistribution/archlinux.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
],
1919
"fact": {
2020
"name": "Arch Linux",
21-
"major": 20,
22-
"minor": 6,
21+
"major": null,
22+
"minor": null,
2323
"release_meta": {
2424
"NAME": "Arch Linux",
2525
"PRETTY_NAME": "Arch Linux",

0 commit comments

Comments
 (0)