uyuni
uyuni copied to clipboard
Fix NPE in getDnsFqdns()
What does this PR change?
Fix NPE in hardware refresh with a Salt-SSH Centos 7 minion without any activation key
GUI diff
No difference.
- [X] DONE
Documentation
- No documentation needed: only internal and user invisible changes
- [X] DONE
Test coverage
-
No tests: already covered
-
[X] DONE
Links
Fixes https://bugzilla.suse.com/show_bug.cgi?id=1203611
- [X] 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)
Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:
- [ ] Re-run test "changelog_test"
- [ ] Re-run test "backend_unittests_pgsql"
- [ ] Re-run test "java_pgsql_tests"
- [ ] Re-run test "schema_migration_test_pgsql"
- [ ] Re-run test "susemanager_unittests"
- [ ] Re-run test "javascript_lint"
- [ ] Re-run test "spacecmd_unittests"
Ok, I will leave this one "open" so the discussion and maybe some changes can continue. For 4.3 I will merge to unblock QE
Also i just noticed this would not handle the case when the Map does not contain "dns_fqdns". To handle that you can replace the map with .flatMap(s -> Optional.ofNullable(s.get("dns_fqdns")))
@lucidd when adding unit tests based on real data I found out that the fix was not completely correct. It should be better (and tested) now