domain.py patch

Michael Wood esiotrot at gmail.com
Fri Apr 20 02:35:35 MDT 2012


Daniele,

Now that your patch has been included in the official repository, you
might want to rebase your repository.  Otherwise every time you pull
in future, git will do a merge and your commit IDs will never match up
with the ones in the official repository.

If you just "git rebase origin/master" it should basically remove your
local version of the commit and replace it with the one in the
official repository.  The commit in the official repository shows that
it was committed by Andrew, but still has you as the author:

commit f1f00e5ba0b52bafac8532fba19112ebbed06738
Author:     Daniele Dario <d.dario76 at gmail.com>
AuthorDate: Thu Apr 19 12:13:41 2012 +0200
Commit:     Andrew Bartlett <abartlet at samba.org>
CommitDate: Thu Apr 19 19:15:05 2012 +0200

    Added number of FSMO roles owned by the server we are trying to demote.

On 20 April 2012 01:53, Andrew Bartlett <abartlet at samba.org> wrote:
> On Thu, 2012-04-19 at 13:18 +0200, Daniele Dario wrote:
>> Hi Andrew,
>>
>> On Thu, 2012-04-19 at 14:40 +1000, Andrew Bartlett wrote:
>> > On Mon, 2012-04-16 at 09:12 +0200, Daniele Dario wrote:
>> > > 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.
>> >
>> > This snippet will get your own own NDTS Setting DN:
>> >
>> > +        res = samdb.search("",
>> > +                                scope=ldb.SCOPE_BASE,
>> > attrs=["dsServiceName"])
>> > +        assert len(res) == 1
>> > +        serviceName = res[0]["dsServiceName"][0]
>> >
>> > If you could return your patch in diff -u format (or better still, as a
>> > git commit, and git format-patch -1) I'll be very glad to get some
>> > improvements here into the tree.
>> >
>> > Thanks!
>> >
>> > Andrew Bartlett
>> >
>>  I've also added the git format-patch -1 patch.
>
> That made it very easy for me to include, and it is now in master!
>
> Thanks!
>
> --
> Andrew Bartlett                                http://samba.org/~abartlet/
> Authentication Developer, Samba Team           http://samba.org
>



-- 
Michael Wood <esiotrot at gmail.com>


More information about the samba-technical mailing list