|
|
9991ea |
From c805cd76acc8fbc9c2cb689deaf6e5eae78700c5 Mon Sep 17 00:00:00 2001
|
|
|
9991ea |
From: Alexander Bokovoy <abokovoy@redhat.com>
|
|
|
9991ea |
Date: Wed, 15 Jan 2014 15:42:10 +0200
|
|
|
9991ea |
Subject: [PATCH 24/25] trustdomain-find: report status of the (sub)domain
|
|
|
9991ea |
|
|
|
9991ea |
Show status of each enumerated domain
|
|
|
9991ea |
|
|
|
9991ea |
trustdomain-find shows list of domains associated with the trust.
|
|
|
9991ea |
Each domain except the trust forest root can be enabled or disabled
|
|
|
9991ea |
with the help of trustdomain-enable and trustdomain-disable commands.
|
|
|
9991ea |
|
|
|
9991ea |
https://fedorahosted.org/freeipa/ticket/4096
|
|
|
9991ea |
---
|
|
|
9991ea |
ipalib/plugins/trust.py | 18 +++++++++++++++++-
|
|
|
9991ea |
1 file changed, 17 insertions(+), 1 deletion(-)
|
|
|
9991ea |
|
|
|
9991ea |
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py
|
|
|
9991ea |
index a16c23083662fd674c45ba54b9dfb9f4837160df..3d412c9c9f518347769e88ddc9089d6d92ccc4be 100644
|
|
|
9991ea |
--- a/ipalib/plugins/trust.py
|
|
|
9991ea |
+++ b/ipalib/plugins/trust.py
|
|
|
9991ea |
@@ -21,7 +21,7 @@
|
|
|
9991ea |
from ipalib.plugins.baseldap import *
|
|
|
9991ea |
from ipalib.plugins.dns import dns_container_exists
|
|
|
9991ea |
from ipapython.ipautil import realm_to_suffix
|
|
|
9991ea |
-from ipalib import api, Str, StrEnum, Password, _, ngettext
|
|
|
9991ea |
+from ipalib import api, Str, StrEnum, Password, Bool, _, ngettext
|
|
|
9991ea |
from ipalib import Command
|
|
|
9991ea |
from ipalib import errors
|
|
|
9991ea |
from ldap import SCOPE_SUBTREE
|
|
|
9991ea |
@@ -1183,8 +1183,24 @@ def get_dn(self, *keys, **kwargs):
|
|
|
9991ea |
class trustdomain_find(LDAPSearch):
|
|
|
9991ea |
__doc__ = _('Search domains of the trust')
|
|
|
9991ea |
|
|
|
9991ea |
+ has_output_params = LDAPSearch.has_output_params + (
|
|
|
9991ea |
+ Flag('domain_enabled', label= _('Domain enabled')),
|
|
|
9991ea |
+ )
|
|
|
9991ea |
def pre_callback(self, ldap, filters, attrs_list, base_dn, scope, *args, **options):
|
|
|
9991ea |
return (filters, base_dn, ldap.SCOPE_SUBTREE)
|
|
|
9991ea |
+
|
|
|
9991ea |
+ def post_callback(self, ldap, entries, truncated, *args, **options):
|
|
|
9991ea |
+ trust_dn = self.obj.get_dn(args[0], trust_type=u'ad')
|
|
|
9991ea |
+ trust_entry = ldap.get_entry(trust_dn)
|
|
|
9991ea |
+ for entry in entries:
|
|
|
9991ea |
+ sid = entry['ipanttrusteddomainsid'][0]
|
|
|
9991ea |
+ if sid in trust_entry['ipantsidblacklistincoming']:
|
|
|
9991ea |
+ entry['domain_enabled'] = [False]
|
|
|
9991ea |
+ else:
|
|
|
9991ea |
+ entry['domain_enabled'] = [True]
|
|
|
9991ea |
+ return truncated
|
|
|
9991ea |
+
|
|
|
9991ea |
+
|
|
|
9991ea |
api.register(trustdomain_find)
|
|
|
9991ea |
|
|
|
9991ea |
class trustdomain_mod(LDAPUpdate):
|
|
|
9991ea |
--
|
|
|
9991ea |
1.8.4.2
|
|
|
9991ea |
|