summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2011-07-01 12:26:35 +0300
committerAlexander Bokovoy <abokovoy@redhat.com>2011-07-01 12:26:35 +0300
commit8d4360cff1ba0dbe60c5a072ed19eb5e358290ce (patch)
tree6b4c5bf19ba6e81f916288b62864015e28c4121e
parenta7cd88f5aa2db2c18fe76c612573ec28eb51fd40 (diff)
parentd29143ce5f6364dfc93dd0228dc58199f956b0a6 (diff)
downloadfreeipa-8d4360cff1ba0dbe60c5a072ed19eb5e358290ce.zip
freeipa-8d4360cff1ba0dbe60c5a072ed19eb5e358290ce.tar.gz
freeipa-8d4360cff1ba0dbe60c5a072ed19eb5e358290ce.tar.xz
Merge branch 'ticket-1369' into testing
-rwxr-xr-xipa-client/ipa-install/ipa-client-install3
-rw-r--r--ipapython/ipautil.py18
2 files changed, 20 insertions, 1 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 644afc6..f065e7f 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -974,7 +974,8 @@ def main():
n = n + 1
if not found:
- print "nss_ldap is not able to use DNS discovery!"
+ package = package_installed_name(["nss-pam-ldapd","nss_ldap"])
+ print "Unable to use DNS discovery! Recognized configuration: %s" % (package)
print "Changing configuration to use hardcoded server name: " +cli_server
try:
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 91d19e9..1573e0a 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -1169,3 +1169,21 @@ def bind_port_responder(port, socket_stream=True, socket_timeout=None, responder
s.sendto(responder_data, addr)
finally:
s.close()
+
+def package_installed_name(packages):
+ """
+ Find out which of mutually exclusive packages is installed
+
+ packages is a list of package names to check
+
+ Returns package name or None
+ """
+
+ args = ["/bin/rpm","-q","--queryformat","%{NAME}"]
+ for package in packages:
+ try:
+ (package_name, error, retcode) = run(args+[package])
+ return package_name
+ except CalledProcessError:
+ continue
+ return None