Blame SOURCES/authconfig-6.2.8-sssd-catch-NoServiceError-exception.patch

977b74
From 6cb26b2d4ea21bc9f44f8448e2749b4624ff0581 Mon Sep 17 00:00:00 2001
977b74
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
977b74
Date: Thu, 20 Apr 2017 12:04:15 +0200
977b74
Subject: [PATCH] sssd: catch NoServiceError exception
977b74
977b74
SSSDConfig throws an NoServiceError exception if the service is not
977b74
yet present in the configuration file. We need to catch it and
977b74
create the service manually in such situation.
977b74
---
977b74
 authinfo.py | 5 ++++-
977b74
 1 file changed, 4 insertions(+), 1 deletion(-)
977b74
977b74
diff --git a/authinfo.py b/authinfo.py
977b74
index 7ef7453f6dea5e363a17efe199338a0646c20a51..510e6d5f140fd61322286c8eb630e88efeb5db11 100644
977b74
--- a/authinfo.py
977b74
+++ b/authinfo.py
977b74
@@ -3113,7 +3113,10 @@ class AuthInfo:
977b74
 		if not self.sssdConfig:
977b74
 			return True
977b74
 
977b74
-		pam = self.sssdConfig.get_service('pam')
977b74
+		try:
977b74
+			pam = self.sssdConfig.get_service('pam')
977b74
+		except SSSDConfig.NoServiceError:
977b74
+			pam = self.sssdConfig.new_service('pam')
977b74
 
977b74
 		if self.enableSmartcard and self.enableSSSDAuth and self.smartcardModule == "sssd" :
977b74
 			pam.set_option('pam_cert_auth', 'True')
977b74
-- 
977b74
2.9.3
977b74