diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2019-09-26 19:43:29 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-09-26 19:43:29 +0000 |
commit | 0948cdfbef2052cdf839f24d6a17d457aa9fd4d3 (patch) | |
tree | f706bf38676acdd7fb5bba588550e80a35089fcf /cloudinit/net/sysconfig.py | |
parent | 66ef979a2d7b8003def1ee4d7a6b6a261b37e0ee (diff) | |
download | vyos-cloud-init-0948cdfbef2052cdf839f24d6a17d457aa9fd4d3.tar.gz vyos-cloud-init-0948cdfbef2052cdf839f24d6a17d457aa9fd4d3.zip |
sysconfig: use distro variant to check if available
The sysconfig renderer used the distro name directly which mean
some variants of distros were not considered supported. Fix this
by using util.system_info()['variant'] instead. Fix the list of
KNOWN_DISTROS value for redhat -> rhel.
LP: #1843584
Diffstat (limited to 'cloudinit/net/sysconfig.py')
-rw-r--r-- | cloudinit/net/sysconfig.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index be5dede7..416c1c97 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -18,8 +18,7 @@ from .network_state import ( LOG = logging.getLogger(__name__) NM_CFG_FILE = "/etc/NetworkManager/NetworkManager.conf" -KNOWN_DISTROS = [ - 'opensuse', 'sles', 'suse', 'redhat', 'fedora', 'centos'] +KNOWN_DISTROS = ['centos', 'fedora', 'rhel', 'suse'] def _make_header(sep='#'): @@ -731,7 +730,7 @@ class Renderer(renderer.Renderer): def available(target=None): sysconfig = available_sysconfig(target=target) nm = available_nm(target=target) - return (util.get_linux_distro()[0] in KNOWN_DISTROS + return (util.system_info()['variant'] in KNOWN_DISTROS and any([nm, sysconfig])) |