From 33fb94982665a23d38c7e51e17f632f3bc6f47bd Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 29 Oct 2012 10:06:45 +0100 Subject: Make enabling the autofs service more robust --- ipa-client/ipa-install/ipa-client-automount | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'ipa-client') diff --git a/ipa-client/ipa-install/ipa-client-automount b/ipa-client/ipa-install/ipa-client-automount index 182f9f65..fd922b8a 100755 --- a/ipa-client/ipa-install/ipa-client-automount +++ b/ipa-client/ipa-install/ipa-client-automount @@ -154,14 +154,19 @@ def configure_autofs_sssd(fstore, statestore, autodiscover, options): except Exception, e: sys.exit(e) - if 'autofs' not in sssdconfig.list_services(): - sssdconfig.new_service('autofs') - try: - sssdconfig.activate_service('autofs') - except SSSDConfig.NoServiceError: - print "Unable to activate the autofs service in SSSD config." - root_logger.debug("Unable to activate the autofs service in SSSD config.") + sssdconfig.new_service('autofs') + except SSSDConfig.ServiceAlreadyExists: + pass + except SSSDConfig.ServiceNotRecognizedError: + root_logger.error("Unable to activate the Autofs service in SSSD config.") + root_logger.info( + "Please make sure you have SSSD built with autofs support installed.") + root_logger.info( + "Configure autofs support manually in /etc/sssd/sssd.conf.") + sys.exit("Cannot create the autofs service in sssd.conf") + + sssdconfig.activate_service('autofs') domain = None for name in domains: -- cgit