diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2019-04-22 22:46:40 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-04-22 22:46:40 +0000 |
commit | 5de83fc54c17b504842a924e7db08e8c2c1cebf9 (patch) | |
tree | 7d3d07c310d063429d6ef553b518116beac314aa /cloudinit | |
parent | 69251d5b4431204c1e768fdf6e9f268edceb2e96 (diff) | |
download | vyos-cloud-init-5de83fc54c17b504842a924e7db08e8c2c1cebf9.tar.gz vyos-cloud-init-5de83fc54c17b504842a924e7db08e8c2c1cebf9.zip |
net/sysconfig: only indicate available on known sysconfig distros
Restrict the sysconfig renderer availabily to known distros.
Ubuntu/Debian systems may include network-manager but they do
not have support for reading sysconfig network output; that is
enabled via a Network-Manager plugin: ifcfg-rh which is not
available in Ubuntu/Debian.
LP: #1819994
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/net/sysconfig.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index 09983929..a47da0a8 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -18,6 +18,8 @@ from .network_state import ( LOG = logging.getLogger(__name__) NM_CFG_FILE = "/etc/NetworkManager/NetworkManager.conf" +KNOWN_DISTROS = [ + 'opensuse', 'sles', 'suse', 'redhat', 'fedora', 'centos'] def _make_header(sep='#'): @@ -717,8 +719,8 @@ class Renderer(renderer.Renderer): def available(target=None): sysconfig = available_sysconfig(target=target) nm = available_nm(target=target) - - return any([nm, sysconfig]) + return (util.get_linux_distro()[0] in KNOWN_DISTROS + and any([nm, sysconfig])) def available_sysconfig(target=None): |