Skip to content

inventory/linux: Use Python script to check version#3088

Merged
nickanderson merged 1 commit intocfengine:masterfrom
btriller:inventory-linux-python
Apr 15, 2026
Merged

inventory/linux: Use Python script to check version#3088
nickanderson merged 1 commit intocfengine:masterfrom
btriller:inventory-linux-python

Conversation

@btriller
Copy link
Copy Markdown
Contributor

Get rid of shells and other command and use Python itself for version check.
Get major/minor via tuple for compatibility with very ancient Python versions (sys.version_info.major etc introduced in 2.7) [1].

[1] https://docs.python.org/2/library/sys.html#sys.version_info

@cf-bottom
Copy link
Copy Markdown

Thank you for submitting a pull request! Maybe @craigcomstock can review this?

Copy link
Copy Markdown
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. Thanks for the contribution! :)

Copy link
Copy Markdown
Member

@nickanderson nickanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok, but maybe it can be simplified further?

Comment thread inventory/linux.cf Outdated
@btriller btriller force-pushed the inventory-linux-python branch from 9a99650 to e4a5fe5 Compare April 13, 2026 15:48
Get rid of shells and other command and use Python itself for version
check.
Get major/minor via tuple for compatibility with very ancient Python
versions (sys.version_info.major etc introduced in 2.7) [1].

[1] https://docs.python.org/2/library/sys.html#sys.version_info

Co-Authored-By: Nick Anderson <nick@cmdln.org>
@nickanderson nickanderson force-pushed the inventory-linux-python branch from e4a5fe5 to 05a3b1d Compare April 15, 2026 18:10
@nickanderson nickanderson self-assigned this Apr 15, 2026
@nickanderson nickanderson merged commit 04d1a7e into cfengine:master Apr 15, 2026
7 checks passed
@btriller btriller deleted the inventory-linux-python branch April 15, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants