Skip to content

Do not print an error if /etc/susemanager-release does not exist #597

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

Conversation

deneb-alpha
Copy link
Contributor

@deneb-alpha deneb-alpha commented Jun 3, 2025

What does this PR change?

Currently, when running Uyuni, the attempt to parse the non existing /etc/susemanager-release results in a misleading message in the logs like sed: can't read /etc/susemanager-release: No such file or directory.

Even if this missing config file is not a problem and actually is expected on Uyuni, the message is misleading and gives the impression that there's a real issue.

See for example: uyuni-project/uyuni#10401

The PR change the way to compute the suse_manager_release, validating first if the file exists or if, like in the case of an Uyuni setup, the file is expected to be missing. With this validation, the sed command doesn't print the message can't read /etc/susemanager-release: No such file or directory but, when the file exists, the value is correctly extracted and stored.

Codespace

Check if you already have a running container clicking on Running CodeSpace

Create CodeSpace About billing for Github Codespaces CodeSpace Billing Summary CodeSpace Limit

Test coverage

  • Adapted test

  • DONE

Links

Fixes: uyuni-project/uyuni#10279

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Before you merge

Check How to branch and merge properly!

@deneb-alpha deneb-alpha requested a review from cbosdo June 3, 2025 16:28
@deneb-alpha deneb-alpha force-pushed the susemanager-release_ServerInspectData branch from 4225675 to 27b1f8b Compare June 3, 2025 16:50
@deneb-alpha deneb-alpha requested a review from mbussolotto June 4, 2025 07:35
@deneb-alpha deneb-alpha force-pushed the susemanager-release_ServerInspectData branch from 27b1f8b to a8630aa Compare June 4, 2025 09:00
Copy link

sonarqubecloud bot commented Jun 4, 2025

Copy link
Member

@mbussolotto mbussolotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deneb-alpha deneb-alpha merged commit b8b23ab into uyuni-project:main Jun 4, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sed: can't read /etc/susemanager-release: No such file or directory
2 participants