[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Thu Sep 27 12:27:02 MDT 2012


The branch, master has been updated
       via  b7822a5 samba4-tests: Move 'samba.tests.source' up.
       via  0883e17 sanba.upgradehelpers: Use standard functionality for getting temp dir.
       via  2a797f2 s4-python: Various formatting fixes.
       via  6986f7b samba.tests.source: Check for trailing whitespace in Python files.
       via  f8aab2f smb.conf(5): Add basic documentation for 'dcerpc endpoint servers'.
      from  aad669b s3: Fix some blank line endings

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b7822a55c40c5c42356b263c3d7bc1998fb1a7d3
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Sep 27 09:41:32 2012 -0700

    samba4-tests: Move 'samba.tests.source' up.
    
    We would like to run this as early as possible so we get a quick
    failure when there is trailing whitespace.
    
    Autobuild-User(master): Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date(master): Thu Sep 27 20:26:27 CEST 2012 on sn-devel-104

commit 0883e174bfdec22a4ff373041afce396cfe7fd7b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Sep 27 09:34:36 2012 -0700

    sanba.upgradehelpers: Use standard functionality for getting temp dir.

commit 2a797f29aa12f6847844af504026be52db659fbb
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Sep 27 09:30:47 2012 -0700

    s4-python: Various formatting fixes.
    
    * Trailing whitespace
    * use of "==" where "is" should be used
    * double spaces

commit 6986f7bdda56d693c642945485006f9660053758
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Sep 27 09:30:26 2012 -0700

    samba.tests.source: Check for trailing whitespace in Python files.

commit f8aab2f55fb552c6fd1fc51106cc237f9a1fc32a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Sep 26 18:01:35 2012 -0700

    smb.conf(5): Add basic documentation for 'dcerpc endpoint servers'.

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/nothreads.py                   |    6 +-
 buildtools/wafsamba/samba_abi.py                   |    2 +-
 buildtools/wafsamba/samba_autoconf.py              |   10 +-
 buildtools/wafsamba/samba_bundled.py               |    2 +-
 buildtools/wafsamba/samba_deps.py                  |    8 +-
 buildtools/wafsamba/samba_dist.py                  |    4 +-
 buildtools/wafsamba/samba_headers.py               |    1 -
 buildtools/wafsamba/samba_optimisation.py          |    2 +-
 buildtools/wafsamba/samba_patterns.py              |    2 +-
 buildtools/wafsamba/samba_utils.py                 |   10 +-
 buildtools/wafsamba/samba_version.py               |    2 +-
 buildtools/wafsamba/stale_files.py                 |    2 +-
 buildtools/wafsamba/wafsamba.py                    |    4 +-
 .../smbdotconf/protocol/dcerpcendpointservers.xml  |   12 ++
 selftest/tests.py                                  |   23 ++++
 selftest/wscript                                   |    3 +-
 source4/scripting/bin/samba_dnsupdate              |   15 ++-
 source4/scripting/bin/samba_kcc                    |  117 +++++++++---------
 source4/scripting/bin/samba_upgradeprovision       |   16 ++--
 source4/scripting/python/samba/__init__.py         |    2 +-
 source4/scripting/python/samba/dbchecker.py        |    8 +-
 source4/scripting/python/samba/drs_utils.py        |    2 +-
 source4/scripting/python/samba/kcc_utils.py        |   46 ++++----
 source4/scripting/python/samba/ms_schema.py        |   34 +++---
 source4/scripting/python/samba/netcmd/__init__.py  |    2 +-
 .../scripting/python/samba/netcmd/delegation.py    |    6 +-
 source4/scripting/python/samba/netcmd/domain.py    |   20 ++--
 source4/scripting/python/samba/netcmd/fsmo.py      |    2 +-
 source4/scripting/python/samba/netcmd/gpo.py       |    4 +-
 source4/scripting/python/samba/netcmd/ldapcmp.py   |    7 +-
 source4/scripting/python/samba/netcmd/ntacl.py     |   18 ++--
 source4/scripting/python/samba/netcmd/spn.py       |   14 +-
 source4/scripting/python/samba/ntacls.py           |   18 ++--
 .../scripting/python/samba/provision/__init__.py   |    4 +-
 .../scripting/python/samba/provision/backend.py    |    2 +-
 source4/scripting/python/samba/schema.py           |    8 +-
 source4/scripting/python/samba/tests/auth.py       |    4 +-
 source4/scripting/python/samba/tests/core.py       |    4 +-
 .../scripting/python/samba/tests/credentials.py    |    6 +-
 .../scripting/python/samba/tests/dcerpc/bare.py    |   12 +-
 .../python/samba/tests/dcerpc/registry.py          |    2 +-
 .../scripting/python/samba/tests/dcerpc/unix.py    |    2 +-
 source4/scripting/python/samba/tests/dns.py        |    4 +-
 source4/scripting/python/samba/tests/gensec.py     |    8 +-
 source4/scripting/python/samba/tests/provision.py  |    2 +-
 source4/scripting/python/samba/tests/samba3.py     |    4 +-
 source4/scripting/python/samba/tests/samba3sam.py  |  132 ++++++++++----------
 .../python/samba/tests/samba_tool/ntacl.py         |    8 +-
 source4/scripting/python/samba/tests/samdb.py      |   10 +-
 source4/scripting/python/samba/tests/source.py     |   17 +++-
 .../python/samba/tests/upgradeprovision.py         |    2 +-
 source4/scripting/python/samba/tests/xattr.py      |    2 +-
 source4/scripting/python/samba/upgrade.py          |    6 +-
 source4/scripting/python/samba/upgradehelpers.py   |   13 +--
 source4/selftest/tests.py                          |    1 -
 55 files changed, 363 insertions(+), 314 deletions(-)
 create mode 100644 docs-xml/smbdotconf/protocol/dcerpcendpointservers.xml
 create mode 100644 selftest/tests.py


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/nothreads.py b/buildtools/wafsamba/nothreads.py
index 90babf4..075dcd3 100644
--- a/buildtools/wafsamba/nothreads.py
+++ b/buildtools/wafsamba/nothreads.py
@@ -132,8 +132,10 @@ class Parallel(object):
                 self.frozen = []
             elif not self.count:
                 (jobs, tmp) = self.manager.get_next_set()
-                if jobs != None: self.maxjobs = jobs
-                if tmp: self.outstanding += tmp
+                if jobs is not None:
+                    self.maxjobs = jobs
+                if tmp:
+                    self.outstanding += tmp
                 break
 
     def get_out(self):
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index f5cac8a..ed977ba 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -154,7 +154,7 @@ def abi_process_file(fname, version, symmap):
 
 def abi_write_vscript(vscript, libname, current_version, versions, symmap, abi_match):
     '''write a vscript file for a library in --version-script format
-    
+
     :param vscript: Path to the vscript file
     :param libname: Name of the library, uppercased
     :param current_version: Current version
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 50039fc..5d3cc5a 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -62,9 +62,9 @@ def COMPOUND_END(conf, result):
     conf.check_message_1 = conf.saved_check_message_1
     conf.check_message_2 = conf.saved_check_message_2
     p = conf.check_message_2
-    if result == True:
+    if result:
         p('ok ')
-    elif result == False:
+    elif not result:
         p('not found', 'YELLOW')
     else:
         p(result)
@@ -241,7 +241,7 @@ def CHECK_FUNC(conf, f, link=True, lib=None, headers=None):
 
     conf.COMPOUND_START('Checking for %s' % f)
 
-    if link is None or link == True:
+    if link is None or link:
         ret = CHECK_CODE(conf,
                          # this is based on the autoconf strategy
                          '''
@@ -284,7 +284,7 @@ def CHECK_FUNC(conf, f, link=True, lib=None, headers=None):
                              headers=headers,
                              msg='Checking for macro %s' % f)
 
-    if not ret and (link is None or link == False):
+    if not ret and (link is None or not link):
         ret = CHECK_VARIABLE(conf, f,
                              define=define,
                              headers=headers,
@@ -470,7 +470,7 @@ def CONFIG_SET(conf, option):
     if option not in conf.env:
         return False
     v = conf.env[option]
-    if v == None:
+    if v is None:
         return False
     if v == []:
         return False
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 1a5d565..b8a4101 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -78,7 +78,7 @@ def LIB_MAY_BE_BUNDLED(conf, libname):
 
 @conf
 def LIB_MUST_BE_BUNDLED(conf, libname):
-    return ('ALL' in conf.env.BUNDLED_LIBS or 
+    return ('ALL' in conf.env.BUNDLED_LIBS or
             libname in conf.env.BUNDLED_LIBS)
 
 @conf
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index f073e41..3220f35 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -136,7 +136,7 @@ def build_includes(self):
     includes = []
 
     # maybe add local includes
-    if getattr(self, 'local_include', True) == True and getattr(self, 'local_include_first', True):
+    if getattr(self, 'local_include', True) and getattr(self, 'local_include_first', True):
         includes.append('.')
 
     includes.extend(self.samba_includes_extended)
@@ -153,7 +153,7 @@ def build_includes(self):
         t = bld.name_to_obj(d, bld.env)
         bld.ASSERT(t is not None, "Unable to find dependency %s for %s" % (d, self.sname))
         inclist = getattr(t, 'samba_includes_extended', [])[:]
-        if getattr(t, 'local_include', True) == True:
+        if getattr(t, 'local_include', True):
             inclist.append('.')
         if inclist == []:
             continue
@@ -169,7 +169,7 @@ def build_includes(self):
         relpath = os_path_relpath(inc, mypath)
         includes.append(relpath)
 
-    if getattr(self, 'local_include', True) == True and not getattr(self, 'local_include_first', True):
+    if getattr(self, 'local_include', True) and not getattr(self, 'local_include_first', True):
         includes.append('.')
 
     # now transform the includes list to be relative to the top directory
@@ -306,7 +306,7 @@ def check_orphaned_targets(bld, tgt_list):
     debug('deps: checking for orphaned targets')
 
     for t in tgt_list:
-        if getattr(t, 'samba_used', False) == True:
+        if getattr(t, 'samba_used', False):
             continue
         type = target_dict[t.sname]
         if not type in ['BINARY', 'LIBRARY', 'MODULE', 'ET', 'PYTHON']:
diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py
index 82492e1..fae2759 100644
--- a/buildtools/wafsamba/samba_dist.py
+++ b/buildtools/wafsamba/samba_dist.py
@@ -98,10 +98,10 @@ def vcs_dir_contents(path):
     return Utils.cmd_output(ls_files_cmd, cwd=cwd, env=env).split()
 
 
-def dist(appname='',version=''):
+def dist(appname='', version=''):
 
     def add_files_to_tarball(tar, srcdir, srcsubdir, dstdir, dstsubdir, blacklist, files):
-        if blacklist == None:
+        if blacklist is None:
             blacklist = []
         for f in files:
             abspath = os.path.join(srcdir, f)
diff --git a/buildtools/wafsamba/samba_headers.py b/buildtools/wafsamba/samba_headers.py
index cca6420..50ccad7 100644
--- a/buildtools/wafsamba/samba_headers.py
+++ b/buildtools/wafsamba/samba_headers.py
@@ -119,7 +119,6 @@ def public_headers_simple(bld, public_headers, header_path=None, public_headers_
             h_name =  h
             inst_name = os.path.basename(h)
         bld.INSTALL_FILES('${INCLUDEDIR}', h_name, destname=inst_name)
-        
 
 
 def PUBLIC_HEADERS(bld, public_headers, header_path=None, public_headers_install=True):
diff --git a/buildtools/wafsamba/samba_optimisation.py b/buildtools/wafsamba/samba_optimisation.py
index 2436e9b..f0f430d 100644
--- a/buildtools/wafsamba/samba_optimisation.py
+++ b/buildtools/wafsamba/samba_optimisation.py
@@ -31,7 +31,7 @@ def apply_incpaths(self):
 
     for path in self.to_list(self.includes):
         if not path in lst:
-            if preproc.go_absolute or path[0] != '/': #os.path.isabs(path):
+            if preproc.go_absolute or path[0] != '/':  # os.path.isabs(path):
                 lst.append(path)
             else:
                 self.env.prepend_value('CPPPATH', path)
diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index dc988c5..615d918 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -21,7 +21,7 @@ def write_version_header(task):
 
 def SAMBA_MKVERSION(bld, target):
     '''generate the version.h header for Samba'''
-    t = bld.SAMBA_GENERATOR('VERSION', 
+    t = bld.SAMBA_GENERATOR('VERSION',
                             rule=write_version_header,
                             source= 'VERSION',
                             target=target,
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index c252663..c1869df 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -256,7 +256,7 @@ def ENFORCE_GROUP_ORDERING(bld):
         @feature('*')
         @before('exec_rule', 'apply_core', 'collect')
         def force_previous_groups(self):
-            if getattr(self.bld, 'enforced_group_ordering', False) == True:
+            if getattr(self.bld, 'enforced_group_ordering', False):
                 return
             self.bld.enforced_group_ordering = True
 
@@ -274,7 +274,7 @@ def ENFORCE_GROUP_ORDERING(bld):
                         debug('group: Forcing up to group %s for target %s',
                               group_name(g), self.name or self.target)
                         break
-                if stop != None:
+                if stop is not None:
                     break
             if stop is None:
                 return
@@ -502,15 +502,15 @@ def CHECK_MAKEFLAGS(bld):
                 if v == 'j':
                     jobs_set = True
                 elif v == 'k':
-                    Options.options.keep = True                
+                    Options.options.keep = True
         elif opt == '-j':
             jobs_set = True
         elif opt == '-k':
-            Options.options.keep = True                
+            Options.options.keep = True
     if not jobs_set:
         # default to one job
         Options.options.jobs = 1
-            
+
 Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS
 
 option_groups = {}
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index e82fd47..67ff232 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -132,7 +132,7 @@ class SambaVersion(object):
     def __init__(self, version_dict, path, env=None, is_install=True):
         '''Determine the version number of samba
 
-See VERSION for the format.  Entries on that file are 
+See VERSION for the format.  Entries on that file are
 also accepted as dictionary entries here
         '''
 
diff --git a/buildtools/wafsamba/stale_files.py b/buildtools/wafsamba/stale_files.py
index 5a91367..2dd08e1 100644
--- a/buildtools/wafsamba/stale_files.py
+++ b/buildtools/wafsamba/stale_files.py
@@ -47,7 +47,7 @@ def replace_refill_task_list(self):
     # paranoia
     if bin_base[-4:] != '/bin':
         raise Utils.WafError("Invalid bin base: %s" % bin_base)
-    
+
     # obtain the expected list of files
     expected = []
     for i in range(len(bld.task_manager.groups)):
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 50bd4fa..59d3a2c 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -285,7 +285,7 @@ def SAMBA_LIBRARY(bld, libname, source,
     if pc_files is not None and not private_library:
         bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
 
-    if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and 
+    if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and
         bld.env['XSLTPROC_MANPAGES']):
         bld.MANPAGES(manpages)
 
@@ -670,7 +670,7 @@ def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None):
     bld.SET_BUILD_GROUP('build_source')
     for s in TO_LIST(source):
         iname = s
-        if installname != None:
+        if installname is not None:
             iname = installname
         target = os.path.join(installdir, iname)
         tgtdir = os.path.dirname(os.path.join(bld.srcnode.abspath(bld.env), '..', target))
diff --git a/docs-xml/smbdotconf/protocol/dcerpcendpointservers.xml b/docs-xml/smbdotconf/protocol/dcerpcendpointservers.xml
new file mode 100644
index 0000000..b6d5ddc
--- /dev/null
+++ b/docs-xml/smbdotconf/protocol/dcerpcendpointservers.xml
@@ -0,0 +1,12 @@
+<samba:parameter name="dcerpc endpoint servers"
+                 context="G"
+				 type="list"
+                 advanced="1" developer="1"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+	<para>Specifies which DCE/RPC endpoint servers should be run.</para>
+</description>
+
+<value type="example">epmapper wkssvc rpcecho samr netlogon lsarpc spoolss drsuapi dssetup unixinfo browser eventlog6 backupkey</value>
+<value type="default">rpcecho</value>
+</samba:parameter>
diff --git a/selftest/tests.py b/selftest/tests.py
new file mode 100644
index 0000000..506ed73
--- /dev/null
+++ b/selftest/tests.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+# This script generates a list of testsuites that should be run as part of
+# the Samba 4 test suite.
+
+# The output of this script is parsed by selftest.pl, which then decides
+# which of the tests to actually run. It will, for example, skip all tests
+# listed in selftest/skip or only run a subset during "make quicktest".
+
+# The idea is that this script outputs all of the tests of Samba 4, not
+# just those that are known to pass, and list those that should be skipped
+# or are known to fail in selftest/skip or selftest/knownfail. This makes it
+# very easy to see what functionality is still missing in Samba 4 and makes
+# it possible to run the testsuite against other servers, such as Samba 3 or
+# Windows that have a different set of features.
+
+# The syntax for a testsuite is "-- TEST --" on a single line, followed
+# by the name of the test, the environment it needs and the command to run, all
+# three separated by newlines. All other lines in the output are considered
+# comments.
+
+from selftesthelpers import *
+
+planpythontestsuite("none", "samba.tests.source")
diff --git a/selftest/wscript b/selftest/wscript
index 0277eb5..9ea2f6f 100644
--- a/selftest/wscript
+++ b/selftest/wscript
@@ -180,7 +180,8 @@ def cmd_testonly(opt):
     if not os.path.isdir(env.SELFTEST_PREFIX):
         os.makedirs(env.SELFTEST_PREFIX, int('755', 8))
 
-    env.TESTLISTS = ('--testlist="${PYTHON} ${srcdir}/source3/selftest/tests.py|" ' +
+    env.TESTLISTS = ('--testlist="${PYTHON} ${srcdir}/selftest/tests.py|" ' +
+                     '--testlist="${PYTHON} ${srcdir}/source3/selftest/tests.py|" ' +
                      '--testlist="${PYTHON} ${srcdir}/source4/selftest/tests.py|"')
 
     if CONFIG_SET(opt, 'AD_DC_BUILD_IS_ENABLED'):
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 2f2c7b5..a700118 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -150,11 +150,16 @@ class dnsobj(object):
             raise Exception("Received unexpected DNS reply of type %s" % self.type)
 
     def __str__(self):
-        if d.type == "A":     return "%s %s %s" % (self.type, self.name, self.ip)
-        if d.type == "AAAA":  return "%s %s %s" % (self.type, self.name, self.ip)
-        if d.type == "SRV":   return "%s %s %s %s" % (self.type, self.name, self.dest, self.port)
-        if d.type == "CNAME": return "%s %s %s" % (self.type, self.name, self.dest)
-        if d.type == "NS":    return "%s %s %s" % (self.type, self.name, self.dest)
+        if d.type == "A":
+            return "%s %s %s" % (self.type, self.name, self.ip)
+        if d.type == "AAAA":
+            return "%s %s %s" % (self.type, self.name, self.ip)
+        if d.type == "SRV":
+            return "%s %s %s %s" % (self.type, self.name, self.dest, self.port)
+        if d.type == "CNAME":
+            return "%s %s %s" % (self.type, self.name, self.dest)
+        if d.type == "NS":
+            return "%s %s %s" % (self.type, self.name, self.dest)
 
 
 def parse_dns_line(line, sub_vars):
diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc
index 2f169a8..e3d38c9 100755
--- a/source4/scripting/bin/samba_kcc
+++ b/source4/scripting/bin/samba_kcc
@@ -301,10 +301,10 @@ class KCC(object):
             #
             # Bit NTDSCONN_OPT_RODC_TOPOLOGY is clear in cn!options
             if same_site:
-                if cn_conn.is_generated() == False:
+                if not cn_conn.is_generated():
                     continue
 
-                if self.my_site.is_cleanup_ntdsconn_disabled() == True:
+                if self.my_site.is_cleanup_ntdsconn_disabled():
                     continue
 
                 # Loop thru connections looking for a duplicate that
@@ -328,10 +328,10 @@ class KCC(object):
                               (cn_conn.whenCreated == cn2_conn.whenCreated and
                                cmp(cn_conn.guid, cn2_conn.guid) < 0))
 
-                    if lesser == True:
+                    if lesser:
                         break
 
-                if lesser and cn_conn.is_rodc_topology() == False:
+                if lesser and not cn_conn.is_rodc_topology():
                     cn_conn.to_be_deleted = True
 
             # Given an nTDSConnection object cn, if the DC with the nTDSDSA
@@ -359,29 +359,29 @@ class KCC(object):
             #
             else: # different site
 
-                if mydsa.is_istg() == False:
+                if not mydsa.is_istg():
                     continue
 
-                if cn_conn.is_generated() == False:
+                if not cn_conn.is_generated():
                     continue
 
-                if self.keep_connection(cn_conn) == True:
+                if self.keep_connection(cn_conn):
                     continue
 
                 # XXX - To be implemented
 
-                if all_connected == False:
+                if not all_connected:
                     continue
 
-                if cn_conn.is_rodc_topology() == False:
+                if not cn_conn.is_rodc_topology():
                     cn_conn.to_be_deleted = True
 
 
         if opts.readonly:
             for dnstr, connect in mydsa.connect_table.items():
-                if connect.to_be_deleted == True:
+                if connect.to_be_deleted:
                     logger.info("TO BE DELETED:\n%s" % connect)
-                if connect.to_be_added == True:
+                if connect.to_be_added:
                     logger.info("TO BE ADDED:\n%s" % connect)
 
             # Peform deletion from our tables but perform
@@ -480,7 +480,7 @@ class KCC(object):
                     drsuapi.DRSUAPI_DRS_NEVER_NOTIFY) == 0x0:
                     t_repsFrom.replica_flags |= drsuapi.DRSUAPI_DRS_NEVER_NOTIFY
 
-        elif same_site == False:
+        elif not same_site:
 
             if (t_repsFrom.replica_flags &
                 drsuapi.DRSUAPI_DRS_NEVER_NOTIFY) == 0x0:
@@ -491,7 +491,7 @@ class KCC(object):
         # not in the same site and the
         # NTDSCONN_OPT_DISABLE_INTERSITE_COMPRESSION bit is
         # clear in cn!options
-        if (same_site == False and
+        if (not same_site and
            (cn_conn.options &
             dsdb.NTDSCONN_OPT_DISABLE_INTERSITE_COMPRESSION) == 0x0):
 
@@ -509,7 +509,7 @@ class KCC(object):
 
         # Bits DRS_DISABLE_AUTO_SYNC and DRS_DISABLE_PERIODIC_SYNC are
         # set in t.replicaFlags if and only if cn!enabledConnection = false.
-        if cn_conn.is_enabled() == False:
+        if not cn_conn.is_enabled():
 
             if (t_repsFrom.replica_flags &
                 drsuapi.DRSUAPI_DRS_DISABLE_AUTO_SYNC) == 0x0:
@@ -586,10 +586,10 @@ class KCC(object):
         # We're not currently supporting SMTP replication
         # so is_smtp_replication_available() is currently
         # always returning False
-        if (same_site == True or
-            cn_conn.transport_dnstr == None or
+        if (same_site or
+            cn_conn.transport_dnstr is None or
             cn_conn.transport_dnstr.find("CN=IP") == 0 or
-            is_smtp_replication_available() == False):
+            not is_smtp_replication_available()):
 
             if (t_repsFrom.replica_flags &
                 drsuapi.DRSUAPI_DRS_MAIL_REP) != 0x0:
@@ -614,14 +614,14 @@ class KCC(object):
                     t_repsFrom.dns_name2 = nastr
 
         else:
-            if (t_repsFrom.replica_flags & \
+            if (t_repsFrom.replica_flags &
                 drsuapi.DRSUAPI_DRS_MAIL_REP) == 0x0:
                 t_repsFrom.replica_flags |= drsuapi.DRSUAPI_DRS_MAIL_REP
 
             # We have a transport type but its not an
             # object in the database
             if cn_conn.transport_dnstr not in self.transport_table.keys():
-                raise Exception("Missing inter-site transport - (%s)" % \
+                raise Exception("Missing inter-site transport - (%s)" %
                                 cn_conn.transport_dnstr)
 
             x_transport = self.transport_table[cn_conn.transport_dnstr]
@@ -656,7 +656,7 @@ class KCC(object):
                                             attrs=attrs)
                 except ldb.ldbError, (enum, estr):
                     raise Exception \
-                        ("Unable to find attr (%s) for (%s) - (%s)" % \
+                        ("Unable to find attr (%s) for (%s) - (%s)" %
                          (x_transport.address_attr, pdnstr, estr))
 
                 msg = res[0]
@@ -696,15 +696,14 @@ class KCC(object):
         #    cn!fromServer references an nTDSDSA object.
         s_dsa = None
 
-        if cn_conn.is_enabled() == True and \
-            cn_conn.is_rodc_topology() == False:
+        if cn_conn.is_enabled() and not cn_conn.is_rodc_topology():
 
             s_dnstr = cn_conn.get_from_dnstr()


-- 
Samba Shared Repository


More information about the samba-cvs mailing list