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

Only compare OS versions if dig was successful #5056

Merged
merged 6 commits into from
Dec 11, 2022

Conversation

rdwebdesign
Copy link
Member

What does this PR aim to accomplish?:

On the current Debug Log code, if the dig command fails it is impossible to check if the OS is supported, but the log prints an error message saying the OS is unsupported (even when that's not true), like this:

*** [ DIAGNOSING ]: Operating system
[i] dig return code:  10
[i] dig response:  dig: couldn't get address for 'ns1.pi-hole.net': failure
[✗] Distro:  Debian
[✗] Error: Debian is not a supported distro (https://docs.pi-hole.net/main/prerequisites/)

How does this PR accomplish the above?:

Modifying the os_check() function to compare versions only if dig returns without error.
Also, adding a new error message for this case:

*** [ DIAGNOSING ]: Operating system
[i] dig return code:  10
[i] dig response:  dig: couldn't get address for 'ns1.pi-hole.net': failure
[✗] Distro:  Debian
[✗] Error:  dig command failed - Unable to check OS

Link documentation PRs if any are needed to support this PR:
none


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
also use INFO instead of CROSS, because it's not an error.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
- add red color to dig errors
- reorder some output lines
- add "Distro and version supported" on success

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
@PromoFaux PromoFaux changed the title Only compare OS versions if dig was successful (fixed) Only compare OS versions if dig was successful Dec 11, 2022
@PromoFaux
Copy link
Member

Note: This is a redo of #5050 - in which things went very wrong somehow.

@PromoFaux PromoFaux self-requested a review December 11, 2022 17:46
PromoFaux
PromoFaux previously approved these changes Dec 11, 2022
Co-authored-by: yubiuser <ckoenig@posteo.de>
Signed-off-by: Adam Warner <github@adamwarner.co.uk>
@PromoFaux PromoFaux merged commit 7971cf0 into development Dec 11, 2022
@PromoFaux PromoFaux deleted the tweak/os_check_error branch December 11, 2022 18:00
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-20-1-web-v5-18-1-and-core-v5-15-released/60495/1

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

Successfully merging this pull request may close these issues.

3 participants