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

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