sysconfig renderer not detected on SLE distros
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
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_
expected = ['ifup', 'ifdown']
search = ['/sbin', '/usr/sbin']
for p in expected:
if not util.which(p, search=search, target=target):
return False
expected_paths = [
for p in expected_paths:
if not os.path.
return False
return True
Meaning after we find ifup and ifdown the code also looks for files in "/etc/sysconfig
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
- Server Team CI bot: Approve (continuous-integration)
- Ryan Harper: Approve
-
Diff: 20 lines (+4/-4)1 file modifiedcloudinit/net/sysconfig.py (+4/-4)
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.