mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 08:12:15 -04:00
Added method to get the LIKE var contents as a list
This commit is contained in:
parent
7ab09f5ddf
commit
95fad04fdd
1 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue