From 95fad04fdd69c8768ff126bdd7b43fa76c6151b1 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Sat, 30 Jul 2016 10:39:35 +0300 Subject: [PATCH] Added method to get the LIKE var contents as a list --- certbot/util.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/certbot/util.py b/certbot/util.py index 65aae59e2..1d3e5953c 100644 --- a/certbot/util.py +++ b/certbot/util.py @@ -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