I'm running it in pdb now, and found the following:
x and y are of type ad.protocol.netlogon.Reply
the attribute orig_hostname is present, but doing dir(x) and dir(y) in
pdb does not show the port attribute for either.
the orig_hostname for both x and y at the time of error are valid
domain controllers.
I'm looking at the latest svn code for the Reply object, and it is
created with the following code:
for key in kwargs:
setattr(self, key, kwargs[key])
# from
http://www.boskant.nl/trac/python-ad/browser/lib/ad/protocol/netlogon.py
line 39 and following
Based on this, if port is not passed in as a keyword argument to the
Reply(...) constructor, it will not be present in the resulting
object.
It appears to me that the ad.protocol.netlogon.Client code directly
parses the returned netlogon attribute from the domain controller
without checking if the port attribute is present. Our domain
controller is not including port in that reply. The dir(x) and dir(y)
for mine show:
(Pdb) dir(x)
['__class__', '__delattr__', '__dict__', '__doc__',
'__getattribute__', '__hash__', '__init__', '__module__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__',
'__weakref__', 'address', 'checked', 'client_site', 'domain',
'domain_guid', 'flags', 'forest', 'hostname', 'netbios_domain',
'netbios_hostname', 'orig_domain', 'orig_hostname', 'server_site',
'timing', 'type', 'user']
We're using Windows Server 2003 and I believe the domain functional
level is 2003 native.
Any suggestions? I'll continue specifying the server manually, but
would be nice if the server locating code would not depend on 'port'
being present in the netlogon reply since my domain controllers do not
send that.