From 8abb95575390a6784159afcb163bdef8589f470b Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Fri, 1 Jul 2011 12:15:12 +0300 Subject: Make error reporting more 'local' for various configurations of nss_ldap packages https://fedorahosted.org/freeipa/ticket/1369 When nss_ldap-based configuration does not work, report proper package name instead of always assuming nss_ldap. At least, in RHEL6 and Fedora appropriate package is called nss-pam-ldapd while in older releases and other distributions it might be called differently. The change makes less confusing error reporting. It also introduces common utility function package_installed_name() which provides an interface to query package manager for existence of mutually exclusive packages which is helpful to distinguish between different configuration paths. --- ipa-client/ipa-install/ipa-client-install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ipa-client/ipa-install/ipa-client-install') diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index 884dd213b..d3218d375 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: -- cgit From f6ce5cd6ce30d2081c70cf695bc151a9e7cdeef0 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Fri, 1 Jul 2011 12:31:20 +0300 Subject: Import package_installed_name as well --- ipa-client/ipa-install/ipa-client-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipa-client/ipa-install/ipa-client-install') diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index d3218d375..66a9e4935 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -31,7 +31,7 @@ try: import ipaclient.ipadiscovery import ipaclient.ipachangeconf import ipaclient.ntpconf - from ipapython.ipautil import run, user_input, CalledProcessError, file_exists + from ipapython.ipautil import run, user_input, CalledProcessError, file_exists, package_installed_name from ipapython import ipautil from ipapython import dnsclient from ipapython import sysrestore -- cgit