[PATCH] Re: samba-tool fsmo transfer - uncaught exception

Rowland penny rpenny at samba.org
Sun May 26 11:22:31 UTC 2019

On 26/05/2019 11:59, Douglas Bagnall wrote:
> Rowland Penny  wrote:
>>> Transferring other roles doesn't cause an issue, but as I understand,
>>> only the DNS-related roles require the drs_utils module.
>>> Note that the transfer seems to be effective in the end, as shown with
>>> the command "samba-tool fsmo show". But this exception makes me think
>>> that something did not complete.
>> It seems to be failing whilst trying to replicate the changes, which
>> shouldn't be a big problem, because normal replication should do it.
>> What I am struggling to get my head around is, why does 'import samba'
>> fail when 'import samba.drs_utils' doesn't ?
> Because Python imports are strange like that. The samba module is not
> actually a "module", it is a "package".
> Earlier Julien Ropé wrote:
>> These show the error was found in 4.5, 4.6 and 4.7.
>> Each time, the solution was to modify the file "[samba]/lib/python27/site-packages/samba/netcmd/fsmo.py", by adding the line "import samba.drs_utils".
>> I have verified that this fixes the issue for me.
>> I understand the problem is not seen in every environment, but it still seems to be there for some users.
>> If this issue is known and the fix is so easy, why isn't it applied?
> Probably because nobody supplied the change in a patch format, or if
> somebody did, they weren't persuasive enough. Perhaps they didn't open
> bugzilla bugs.
>> If this is because there is something wrong with the environments of the people that see it, what should they (we) do to fix it? Is editing the code ourselves a good solution, or does that hide something else we should look at in our environment?
> The real fault is in python/samba/tests/samba_tool/fsmo.py which
> *should* test this but does not.
> cheers,
> Douglas

How do you test for something that works on some computers, but not on 
others ?

Which is correct, it working, or it not working ?

If you have a problem with the test, take it up with Andrew, I initially 
created the script following his advice, he later 'improved' it, 
obviously not enough ;-)

Anyway, NACK to your patch, but only because you haven't remove the 
'import samba' line.


More information about the samba-technical mailing list