sysconfig renderer not detected on SLE distros

Bug #1849378 reported by Robert Schweikert on 2019-10-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Medium
Unassigned

Bug Description

Not sure why this is showing up now in a number of instances as the code has been there for quite some time. sysconfig.py contains

def available_sysconfig(target=None):
    expected = ['ifup', 'ifdown']
    search = ['/sbin', '/usr/sbin']
    for p in expected:
        if not util.which(p, search=search, target=target):
            return False

    expected_paths = [
        'etc/sysconfig/network-scripts/network-functions',
        'etc/sysconfig/network-scripts/ifdown-eth']
    for p in expected_paths:
        if not os.path.isfile(util.target_path(target, p)):
            return False
    return True

Meaning after we find ifup and ifdown the code also looks for files in "/etc/sysconfig/network-scripts" this directory does not exist on SUSE distros causing "available_sysconfig" to return always return "False".

Question is why is it necessary to check for the additional files? Could we simply check for "/etc/sysconfig"?

For now I added a patch in the SUSE package that modifies the first loop:

for p in expected:
   if not util.which(p, search=search, target=target):
       return False
else:
    return True

Related branches

Ryan Harper (raharper) wrote :

Hi Robert,

The extra file checks are meant to determine if the image is equipped to configure networking via sysconfig. In both RedHat and SuSE, the /etc/sysconfig directory is owned by the filesystem package and doesn't ensure that image would configure networking.

The paths present are RedHat centric, so we should extend that check the following on SuSE:

/etc/sysconfig/network/config # this is owned by the sysconfig package which provides the network config

And we can drop one of the files that we currently check, both are part of the network-scripts package on RedHat
which enables network-config via sysconfig files.

Changed in cloud-init:
importance: Undecided → Medium
status: New → Triaged
Robert Schweikert (rjschwei) wrote :

Ryan,

Thanks for the background, MR pending.

This bug is fixed with commit 7ccab1bb to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=7ccab1bb

Changed in cloud-init:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers