[Freeipa-devel] [PATCH] 356 Add trusconfig-show and trustconfig-mod commands

Alexander Bokovoy abokovoy at redhat.com
Fri Feb 1 14:55:54 UTC 2013


On Tue, 29 Jan 2013, Martin Kosek wrote:
> trust_output_params = (
>@@ -482,3 +499,158 @@ api.register(trust_mod)
> api.register(trust_del)
> api.register(trust_find)
> api.register(trust_show)
>+
>+
>+_trust_type_option = (
>+    StrEnum('trust_type',
>+        cli_name='type',
>+        label=_('Trust type (ad for Active Directory, default)'),
>+        values=(u'ad',),
>+        default=u'ad',
>+        autofill=True,
>+    ),
>+)
We already have various trust type definitions in the same file. Maybe
it makes sense to unify those somehow?

>+    def get_dn(self, *keys, **kwargs):
>+        trust_type = kwargs.get('trust_type')
>+        if trust_type is None:
>+            raise errors.RequirementError(name='trust_type')
>+        if kwargs['trust_type'] == u'ad':
Perhaps better to define constants for the trust type values...

>+        except ValueError:
>+            # The search is performed for groups with "posixgroup" objectclass
>+            # and not "ipausergroup" so that it can also match groups like
>+            # "Default SMG Group" which does not have this objectclass.
'Default SM_B_ Group'

Thanks for the unit tests too!


-- 
/ Alexander Bokovoy




More information about the Freeipa-devel mailing list