mirror of
https://github.com/certbot/certbot.git
synced 2026-07-26 07:39:52 +02:00
Added method to get the LIKE var contents as a list
This commit is contained in:
@@ -268,6 +268,19 @@ def get_systemd_os_info(filepath="/etc/os-release"):
|
||||
return (os_name, os_version)
|
||||
|
||||
|
||||
def get_systemd_os_like(filepath="/etc/os-release"):
|
||||
"""
|
||||
Get a list of strings that indicate the distribution likeness to
|
||||
other distributions.
|
||||
|
||||
:param str filepath: File path of os-release file
|
||||
:returns: List of distribution acronyms
|
||||
:rtype: `list` of `str`
|
||||
"""
|
||||
|
||||
return _get_systemd_os_release_var("LIKE", filepath).split(" ")
|
||||
|
||||
|
||||
def _get_systemd_os_release_var(varname, filepath="/etc/os-release"):
|
||||
"""
|
||||
Get single value from systemd /etc/os-release
|
||||
|
||||
Reference in New Issue
Block a user