replication: fix regression in get_agreement_type

dcb6916a3b 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>
This commit is contained in:
Petr Vobornik 2015-07-01 18:27:05 +02:00 committed by Tomas Babej
parent e43296ba9a
commit 25a5e38b85

View File

@ -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: