Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysconfig renderer not detected on SLE distros #3478

Closed
ubuntu-server-builder opened this issue May 12, 2023 · 4 comments
Closed

sysconfig renderer not detected on SLE distros #3478

ubuntu-server-builder opened this issue May 12, 2023 · 4 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1849378

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = 2019-12-19T22:58:45.797894+00:00
date_created = 2019-10-22T20:45:42.826550+00:00
date_fix_committed = 2019-10-23T19:06:25.893563+00:00
date_fix_released = 2019-12-19T22:58:45.797894+00:00
id = 1849378
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1849378
milestone = None
owner = rjschwei
owner_name = Robert Schweikert
private = False
status = fix_released
submitter = rjschwei
submitter_name = Robert Schweikert
tags = []
duplicates = []

Launchpad user Robert Schweikert(rjschwei) wrote on 2019-10-22T20:45:42.826550+00:00

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

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Ryan Harper(raharper) wrote on 2019-10-23T14:12:16.239963+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Robert Schweikert(rjschwei) wrote on 2019-10-23T18:00:59.658948+00:00

Ryan,

Thanks for the background, MR pending.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Server Team CI bot(server-team-bot) wrote on 2019-10-23T19:06:24.189024+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Chad Smith(chad.smith) wrote on 2019-12-19T22:58:46.885747+00:00

This bug is believed to be fixed in cloud-init in version 19.2-68. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant