domain.py patch

Daniele Dario d.dario76 at gmail.com
Mon Apr 16 01:12:23 MDT 2012


Hi samba list,
trying to demote my secondary DC, I've found a little typo in the demote
function inside domain.py:
if the DC is the owner of some FSMO rules, the function should tell the
number of rules which DC owns.

I've added the number as in following diff:

251c251
<             raise CommandError("Current DC is still the owner of %d
role(s), use the role command to transfer roles to another DC" %
len(res))
---
>             raise CommandError("Current DC is still the owner of %d
role(s), use the role command to transfer roles to another DC")

Would'n it be better to show also which roles we have to transfer before
demote? I'm thinking something like

        res = samdb.search(expression="(fSMORoleOwner=%s)" %
str(ntds_dn),
                            controls=["search_options:1:2"])

        if len(res) != 0:
            for foundOwnedRole in res
                print foundOwnedRole['fSMORoleOwner'][0]
            raise CommandError("Current DC is still the owner of %d
role(s), use the role command to transfer roles to another DC" %
len(res))

but I don't know which is the right syntax to use to show the role like
CN=NTDS
Settings,CN=MYDC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=mydomain,DC=local

Best regards,
Daniele.



More information about the samba-technical mailing list