[Patch] fix for bug 11613, samba-tool fsmo throws an error

Andrew Bartlett abartlet at samba.org
Sat Dec 5 20:16:34 UTC 2015


On Sat, 2015-12-05 at 21:51 +0200, Uri Simchoni wrote:
> Pushed to autobuild.
> 
> However, I do see other uses of "assert(len(something) == 1)" in 
> python/samba/netcmd and I have to wonder whether they have to be
> fixed too.

If they would indicate a really unlikely situation, then that should be
fine - much as we don't check every search result before de
-referencing. 

Until this bug was raised, I would have assumed all FSMO roles were
filled all the time, but if a server has been deleted it certainly
could appear to be un-filled (links to deleted objects get hidden). 

However there is an issue with the original patch, and I'm sorry for
not getting in earlier with a comment.  The idea of raising an
exception is fine, but if you look at the other exceptions in that
file, they raise a CommandError, not the generic Exception, and we
should do the same here.

This ensures we can catch it correctly and print it nicely, while
leaving real 'crashes' as backtraces. 

Presumably it will be in master by the time you get this, so please
just apply a new patch using CommandError instead of Exception.

Thanks!

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