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

Uri Simchoni uri at samba.org
Sat Dec 5 20:39:01 UTC 2015

On 12/05/2015 10:16 PM, Andrew Bartlett wrote:
> 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
Stopped autobuild in time and pushed a revised version.

More information about the samba-technical mailing list