https://fedorahosted.org/freeipa/ticket/3956

--
PetrĀ³
From 767a49c3ee7c4964453e3b8ffeee23ad2d9bc7bb Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Fri, 4 Oct 2013 13:28:16 +0200
Subject: [PATCH] Do no fail upgrade if the global anonymous read ACI is not
 found

This helps forward compatibility: the anon ACI is scheduled for removal.

https://fedorahosted.org/freeipa/ticket/3956
---
 ipaserver/install/plugins/update_anonymous_aci.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ipaserver/install/plugins/update_anonymous_aci.py b/ipaserver/install/plugins/update_anonymous_aci.py
index af4196a681b163986b0b42c4d8be3e649b2026ac..2e01217f524e35208ab12f52befd54bdead5ac3b 100644
--- a/ipaserver/install/plugins/update_anonymous_aci.py
+++ b/ipaserver/install/plugins/update_anonymous_aci.py
@@ -20,7 +20,7 @@
 from copy import deepcopy
 from ipaserver.install.plugins import FIRST, LAST
 from ipaserver.install.plugins.baseupdate import PostUpdate
-from ipalib import api
+from ipalib import api, errors
 from ipalib.aci import ACI
 from ipalib.plugins import aci
 from ipapython.ipa_log_manager import *
@@ -42,7 +42,11 @@ def execute(self, **options):
 
         acistrs = entry_attrs.get('aci', [])
         acilist = aci._convert_strings_to_acis(entry_attrs.get('aci', []))
-        rawaci = aci._find_aci_by_name(acilist, aciprefix, aciname)
+        try:
+            rawaci = aci._find_aci_by_name(acilist, aciprefix, aciname)
+        except errors.NotFound:
+            root_logger.error('Anonymous ACI not found, cannot update it')
+            return False, False, []
 
         attrs = rawaci.target['targetattr']['expression']
         rawfilter = rawaci.target.get('targetfilter', None)
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to