summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2015-07-01 18:27:05 +0200
committerTomas Babej <tbabej@redhat.com>2015-07-01 19:44:11 +0200
commit25a5e38b85f897cc798609217830b626b7880da1 (patch)
treedcf6742147f751ab3a8cb85e27243e7d0bd30877
parente43296ba9acb20342d2b6d4bb030d06deac39c2a (diff)
downloadfreeipa-25a5e38b85f897cc798609217830b626b7880da1.zip
freeipa-25a5e38b85f897cc798609217830b626b7880da1.tar.gz
freeipa-25a5e38b85f897cc798609217830b626b7880da1.tar.xz
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. Reviewed-By: Tomas Babej <tbabej@redhat.com>
-rw-r--r--ipaserver/install/replication.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index 9333f67..0f42010 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: