590d18
From 8233849dd703e964f6abb70d2a4f37377d5bb7f0 Mon Sep 17 00:00:00 2001
590d18
From: Tomas Babej <tbabej@redhat.com>
590d18
Date: Wed, 5 Aug 2015 17:31:47 +0200
590d18
Subject: [PATCH] Fix incorrect type comparison in trust-fetch-domains
590d18
590d18
Value needs to be unpacked from the list and converted before comparison.
590d18
590d18
https://fedorahosted.org/freeipa/ticket/5182
590d18
590d18
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
590d18
---
590d18
 ipalib/plugins/trust.py | 2 +-
590d18
 1 file changed, 1 insertion(+), 1 deletion(-)
590d18
590d18
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py
590d18
index 6232e4fe9d3d5e957d22a3557cdcf4bb12cec0ea..0bb5e6558b680ac1acad44461d78a571098c7b25 100644
590d18
--- a/ipalib/plugins/trust.py
590d18
+++ b/ipalib/plugins/trust.py
590d18
@@ -1487,7 +1487,7 @@ class trust_fetch_domains(LDAPRetrieve):
590d18
         result['truncated'] = False
590d18
 
590d18
         # For one-way trust fetch over DBus. we don't get the list in this case.
590d18
-        if trust['ipanttrustdirection'] & TRUST_BIDIRECTIONAL != TRUST_BIDIRECTIONAL:
590d18
+        if int(trust['ipanttrustdirection'][0]) != TRUST_BIDIRECTIONAL:
590d18
             fetch_trusted_domains_over_dbus(self.api, self.log, keys[0])
590d18
             result['summary'] = unicode(_('List of trust domains successfully refreshed. Use trustdomain-find command to list them.'))
590d18
             return result
590d18
-- 
590d18
2.4.3
590d18