URL:
https://github.com/freeipa/freeipa/pull/2534
Author: abbra
Title: #2534: [Backport]]ipa-4-7] ipaserver.install.adtrust: fix CID 323644
Action: opened
PR body:
"""
This is a manual backport to account for Python 2.7 differences.
Fix Coverity finding CID 323644: logically dead code path
The code to determine whether NetBIOS name was already set or need to be
set after deriving it from a domain or asking a user for an interactive
input, was refactored at some point to avoid retrieving the whole LDAP
entry. Instead, it was provided with the actual NetBIOS name retrieved.
As result, a part of the code got neglected and was never executed.
Fix this code and provide a test that tries to test predefined,
interactively provided and automatically derived NetBIOS name depending
on how the installer is being run.
We mock up the actual execution so that no access to LDAP or Samba is
needed.
Backport to ipa-4-7 takes into account Python 2.7 differences:
- uses mock instead of unittest.mock if the latter is not available
- derives ApiMockup from object
Fixes:
https://pagure.io/freeipa/issue/7753
Reviewed-By: Christian Heimes <cheimes(a)redhat.com>
(cherry picked from commit 82af034023b03ae64f005c8160b9e961e7b9fd55)
"""
To pull the PR as Git branch:
git remote add ghfreeipa
https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2534/head:pr2534
git checkout pr2534