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

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Sun May 26 10:59:33 UTC 2019

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-samba-tool-fsmo-properly-import-samba.drs_utils.patch
Type: text/x-patch
Size: 981 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190526/7bfd2f61/0001-samba-tool-fsmo-properly-import-samba.drs_utils.bin>

More information about the samba-technical mailing list