[Python-modules-commits] r6833 - in packages/python-ad/trunk/debian/patches (1 file)
mbaldessari-guest at users.alioth.debian.org
mbaldessari-guest at users.alioth.debian.org
Tue Nov 4 22:52:35 UTC 2008
Date: Tuesday, November 4, 2008 @ 22:52:34
Author: mbaldessari-guest
Revision: 6833
* 01_two_dc_one_site patch is included in 0.9
Deleted:
packages/python-ad/trunk/debian/patches/01_two_dc_one_site.dpatch
Deleted: packages/python-ad/trunk/debian/patches/01_two_dc_one_site.dpatch
===================================================================
--- packages/python-ad/trunk/debian/patches/01_two_dc_one_site.dpatch 2008-11-04 11:16:35 UTC (rev 6832)
+++ packages/python-ad/trunk/debian/patches/01_two_dc_one_site.dpatch 2008-11-04 22:52:34 UTC (rev 6833)
@@ -1,84 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 01_two_dc_one_site.dpatch by <Michele Baldessari <michele at pupazzo.org>>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: =Find the DC even when there are two Domain Controllers in one site
-
- at DPATCH@
-diff -urNad python-ad-0.8~/lib/ad/core/locate.py python-ad-0.8/lib/ad/core/locate.py
---- python-ad-0.8~/lib/ad/core/locate.py 2007-12-04 21:44:25.000000000 +0100
-+++ python-ad-0.8/lib/ad/core/locate.py 2008-08-31 20:33:29.000000000 +0200
-@@ -239,8 +239,8 @@
- role `role'.
- """
- self.m_logger.debug('Checking controller %s for domain %s role %s' %
-- (reply.orig_hostname, reply.orig_domain, role))
-- answer = self._dns_query(reply.orig_hostname, 'A')
-+ (reply.q_hostname, reply.q_domain, role))
-+ answer = self._dns_query(reply.q_hostname, 'A')
- if len(answer) != 1:
- self.m_logger.error('Forward DNS returned %d entries (need 1)' %
- len(anser))
-@@ -266,7 +266,7 @@
- role == 'dc' and not (reply.flags & netlogon.SERVER_LDAP):
- self.m_logger.error('Role does not match')
- return False
-- if reply.orig_domain.lower() != reply.domain.lower():
-+ if reply.q_domain.lower() != reply.domain.lower():
- self.m_logger.error('Domain does not match')
- return False
- self.m_logger.debug('Controller is OK')
-@@ -307,9 +307,15 @@
- local.append(reply)
- else:
- remote.append(reply)
-- local.sort(lambda x,y: candidates.index((x.orig_hostname, x.port) -
-- candidates.index(y.orig_hostname, y.port)))
-- remote.sort(lambda x,y: cmp(x.timing, y.timing))
-+ local.sort(lambda x,y: cmp(candidates.index((x.q_hostname, x.q_port)),
-+ candidates.index((y.q_hostname, y.q_port))))
-+ remote.sort(lambda x,y: cmp(x.q_timing, y.q_timing))
-+ self.m_logger.debug('Local DCs: %s' % ', '.join(['%s:%s' %
-+ (x.q_hostname, x.q_port) for x in local]))
-+ self.m_logger.debug('Remote DCs: %s' % ', '.join(['%s:%s' %
-+ (x.q_hostname, x.q_port) for x in remote]))
- result = local + remote
- result = result[:maxservers]
-+ self.m_logger.debug('Selected DCs: %s' % ', '.join(['%s:%s' %
-+ (x.q_hostname, x.q_port) for x in result]))
- return result
-diff -urNad python-ad-0.8~/lib/ad/protocol/netlogon.py python-ad-0.8/lib/ad/protocol/netlogon.py
---- python-ad-0.8~/lib/ad/protocol/netlogon.py 2007-12-02 22:42:53.000000000 +0100
-+++ python-ad-0.8/lib/ad/protocol/netlogon.py 2008-08-31 20:33:29.000000000 +0200
-@@ -285,11 +285,13 @@
- continue
- if not reply:
- continue
-- reply.orig_hostname = hostname
-- reply.orig_domain = domain
-- reply.address = addr
-+ reply.q_hostname = hostname
-+ reply.q_port = port
-+ reply.q_domain = domain
-+ reply.q_msgid = msgid
-+ reply.q_address = addr
- timing = time.time() - begin
-- reply.timing = timing
-+ reply.q_timing = timing
- replies.append(reply)
- return replies
-
-diff -urNad python-ad-0.8~/lib/ad/protocol/test/test_netlogon.py python-ad-0.8/lib/ad/protocol/test/test_netlogon.py
---- python-ad-0.8~/lib/ad/protocol/test/test_netlogon.py 2007-12-02 17:19:25.000000000 +0100
-+++ python-ad-0.8/lib/ad/protocol/test/test_netlogon.py 2008-08-31 20:33:29.000000000 +0200
-@@ -229,7 +229,9 @@
- assert len(res.netbios_hostname) > 0
- assert len(res.client_site) > 0
- assert len(res.server_site) > 0
-- assert res.timing >= 0.0
-+ assert (res.q_hostname, res.q_port) in addrs
-+ assert res.q_domain.lower() == domain.lower()
-+ assert res.q_timing >= 0.0
-
- def test_network_failure(self):
- self.require(ad_user=True, local_admin=True, firewall=True)
More information about the Python-modules-commits
mailing list