From 6cb26b2d4ea21bc9f44f8448e2749b4624ff0581 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Apr 20 2017 10:04:18 +0000 Subject: sssd: catch NoServiceError exception SSSDConfig throws an NoServiceError exception if the service is not yet present in the configuration file. We need to catch it and create the service manually in such situation. --- diff --git a/authinfo.py b/authinfo.py index 7ef7453..510e6d5 100644 --- a/authinfo.py +++ b/authinfo.py @@ -3113,7 +3113,10 @@ class AuthInfo: if not self.sssdConfig: return True - pam = self.sssdConfig.get_service('pam') + try: + pam = self.sssdConfig.get_service('pam') + except SSSDConfig.NoServiceError: + pam = self.sssdConfig.new_service('pam') if self.enableSmartcard and self.enableSSSDAuth and self.smartcardModule == "sssd" : pam.set_option('pam_cert_auth', 'True')