[PATCH] Remove 'samba-tool user add'

Andrew Bartlett abartlet at samba.org
Mon Mar 27 09:01:30 UTC 2017


On Mon, 2017-03-27 at 09:23 +0100, Rowland Penny via samba-technical
wrote:
> On Mon, 27 Mar 2017 20:49:09 +1300
> Andrew Bartlett via samba-technical <samba-technical at lists.samba.org>
> wrote:
> 
> > Partly because it wasn't really deprecated then.  Until Samba 4.5
> > it
> > was a pure alias, with no such message.  Metze fixed that with:
> > 
> > commit 959384ff1843254c3d07a5856687436ea94f2da7
> > Author: Stefan Metzmacher <metze at samba.org>
> > Date:   Thu Jun 2 15:15:52 2016 +0200
> > 
> >     samba-tool: really deprecate 'samba-tool user add'
> >     
> >     Signed-off-by: Stefan Metzmacher <metze at samba.org>
> >     Reviewed-by: Andrew Bartlett <abartlet at samba.org>
> > 
> 
> What a load of rubbish!!
> 
> If you download the samba-4.0.0beta1 tarball and unpack it, then open
> 'source4/scripting/python/samba/netcmd/user.py'
> 
> You will find this:
> 
> class cmd_user_add(cmd_user_create):
>     __doc__ = cmd_user_create.__doc__
>     # take this print out after the add subcommand is removed.
>     # the add subcommand is deprecated but left in for now to allow
> people to migrate to create
> 
>     def run(self, *args, **kwargs):
>         self.err.write("\nNote: samba-tool user add is deprecated.
>     Please use samba-tool user create for the same function.\n")
> return
>     super(self, cmd_user_add).run(*args, **kwargs)
> 
> The word 'deprecated' is there twice.
> 
> If this doesn't mean that 'samba-tool user add' is deprecated then I
> do
> not know what it does mean.

My point is our users don't read our code as often as you do, and don't
see anything written there.  The problem is that Samba 4.4.0 doesn't
print any such message, as it is dead code.

This seems appropriate:

http://www.bcgreen.com/~samuel/comments/hhgttg.html

> > 
> > > Or would you like a patch to remove the deprecate message,
> > > deprecate
> > > 'create' and make it 'add' again ?
> > > 
> > > This would be as stupid as deprecating something and then not
> > > removing
> > > it for over 5 years.
> > 
> > To be clear, it hasn't been 5 years, indeed it hasn't been one
> > since
> > the message actually got to the users (previously it was a pure
> > alias,
> > as I read the patch). 
> 
> No, you are correct, it has been nearer to 6 years.

I've run built and run 4.4.0 and no such message prints.  Sorry.

> > 
> > However, we have met the minimum period, it was finally announced
> > in
> > 4.5 so our 'rules' in this area mean we can remove it from 4.6
> > onwards
> > if we want.
> 
> This is pure sophistry, the command was deprecated before Samba 4.0.0
> was released.
> 
> > 
> > The reason I asked about why is that was hoping for a more
> > compelling
> > reason why this was done - it isn't like there was a unfortunate
> > syntax that couldn't be left during a re-structure, because it was
> > left as an alias!
> 
> The reason why it was deprecated is lost in the mist of time, but
> this
> doesn't really matter, it was deprecated and should have been removed
> before now, if only to stop Samba looking stupid.
> 
> > 
> > BTW, For an idea of Samba's history to keeping our mistakes, see
> > the
> > various spelling mistakes we allow as an alias in the smb.conf!
> 
> I have, and they should have been regarded as typos and fixed,
> instead of being bodged by 'aliasing' them.

Your point is reasonable, it just isn't what we have done.  We tend to
be quite conservative in what we break, even with notice.  For better
or worse, I've found Samba to be a quite conservative project in many
ways, this included. 

Andrew Bartlett
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba




More information about the samba-technical mailing list