[PATCH] samba-tools: add computer subcommand

Andrew Bartlett abartlet at samba.org
Thu Feb 8 20:22:40 UTC 2018

On Thu, 2018-02-08 at 10:08 +0100, Bjoern Baumbach wrote:
> Hi Andrew,
> On 02/08/2018 10:00 AM, Bjoern Baumbach via samba-technical wrote:
> > The move command works like the move command in the user, computer and
> > OU sub command, which I've provided on January 25th. In the computer sub
> > command also with or without the trailing $.
> I've just seen that you have pushed the patches with the new commands.
> Thanks a lot!

Thanks.  You are doing great work and it was a pleasure to review them.

I'm really sorry for dropping the ball on these before 4.8.  We (I)
don't do well with tracking outstanding patches.

One thing that came to mind after pushing them is that this:

>         try:
>             full_new_parent_dn = samdb.normalize_dn_in_domain(new_parent_dn)
>         except Exception, e:
>             raise CommandError('Invalid new_parent_dn "%s": %s' %
>                                (new_parent_dn, e.message))
>         full_new_user_dn = ldb.Dn(samdb, str(user_dn))
>         full_new_user_dn.remove_base_components(len(user_dn)-1)
>         full_new_user_dn.add_base(full_new_parent_dn)
>         try:
>             samdb.rename(user_dn, full_new_user_dn)

Is repeated a lot now.  Can you please generalise it and put that into

As a design pattern we really want to make the code under netcmd as
thin as possible and get into the library code as much as possible.


Andrew Bartlett
Andrew Bartlett
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   

More information about the samba-technical mailing list