dcb6916a3b0601e33b08e12aeb25357efed6812b introduced a regression where get_agreement_type does not raise NotFound error if an agreement for host does not exist. The exception was swallowed by get_replication_agreement.
--
Petr Vobornik
From 4dd4f13c2fc746f800ebbfc81f084ef0690bec63 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 1 Jul 2015 18:27:05 +0200
Subject: [PATCH] replication: fix regression in get_agreement_type

dcb6916a3b0601e33b08e12aeb25357efed6812b introduced a regression where
get_agreement_type does not raise NotFound error if an agreement for host
does not exist. The exception was swallowed by get_replication_agreement.
---
 ipaserver/install/replication.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index efdb7dfdfed1800c2a7f9720e1ce4f5e9ccf42b7..3b5ed29e584b40f1e38f4e068bcef2fbe78c4434 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -1169,6 +1169,9 @@ class ReplicationManager(object):
     def get_agreement_type(self, hostname):
 
         entry = self.get_replication_agreement(hostname)
+        if not entry:
+            raise errors.NotFound(
+                "Replication agreement for %s not found" % hostname)
         objectclass = entry.get("objectclass")
 
         for o in objectclass:
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to