[PATCH] kcc topology generator written as python

Dave Craft wimberosa at gmail.com
Thu Nov 3 12:28:27 MDT 2011


Tridge,

I believe this is now ready for integration as its a good base
for me to build off of and complete the KCC in python.    The changes
that I re-integrated based on comments by others and more review by me are:

       renamed to samba_kcc
       fixed the msg[options] indexing
       RODCs don't have invocationId in their nTDSDSA and code failed on RODC

The three patches are available at:
      https://github.com/wimberosa/samba/tree/kcc-stable

The checkin comments are:
----------------------------------------
commit b7ac219b386c2a051a56591ba98c1d4bdf80c4db
Author: Dave Craft <wimberosa at gmail.com>
Date:   Thu Nov 3 12:39:53 2011 -0500

    samba_kcc addtion

    Scaffolding and initial implementations of
    portions of the KCC in python.  This code currently
    properly computes the graph nodes for the intrasite
    topology as well as enumerating all steps for a full
    run of the KCC.

commit 7190221f6fd81899882b341c615a2a1e390ae661
Author: Dave Craft <wimberosa at gmail.com>
Date:   Thu Nov 3 12:37:24 2011 -0500

    add python KCC utility classes and methods

    New file source4/scripting/python/samba/kcc_utils.py
    contains classes and methods for:
       DirectoryServiceAgent
       NTDSConnection
       GraphNode
       NamingContext
       NCReplica
    These are consumed by a new samba_kcc python script
    for KCC topology computation

commit 9efcb59da5817049390ba2cf1069271608dff2ce
Author: Dave Craft <wimberosa at gmail.com>
Date:   Thu Nov 3 12:33:38 2011 -0500

    python dsdb flag addtions (NTDSSETTINGS, NTDSCONN)

    Add missing flags present in C code base to python
    code base dsdb/pydsdb.c
       INSTANCE_TYPE...
       DS_NTDSSETTINGS_OPT...
       NTDSCONN_OPT...
    These are consumed by the python KCC scripts

On Wed, Nov 2, 2011 at 2:39 AM, Michael Wood <esiotrot at gmail.com> wrote:
> On 2 November 2011 07:23, Andrew Tridgell <tridge at samba.org> wrote:
>> Hi Dave,
>>
>>> As per your suggestions I have rewritten the major portion of the
>>> KCC in python.   The patchsets are available at:
>>>
>>> https://github.com/wimberosa/samba/tree/kcc-stable
> [...]
>>  - the method of walking over the keys() in functions like
>>   load_connection() is unusual. It will work fine, but I think it may
>>   be clearer to ask for that attribute directly. The pattern we usually
>>   use is:
>>
>>  if 'options' in msg:
>>    self.options = int(msg['options'][0])
>>
>>  if you want to make that neater, we could add a helper function a bit
>>  like getattr() that takes a default value. For example:
>>
>>    self.options = ldb_msg_value(msg, 'options', 0)
>
> It's built-in! :)  Well, sort of anyway:
>
> self.options = int(msg.get('options', [0])[0])
>
> --
> Michael Wood <esiotrot at gmail.com>
>



-- 
Regards, Dave Craft
Cut the headlights and put it in neutral.


More information about the samba-technical mailing list