summaryrefslogtreecommitdiff
path: root/python/samba
diff options
context:
space:
mode:
authorJoe Guo <joeg@catalyst.net.nz>2018-07-30 18:22:15 +1200
committerDouglas Bagnall <dbagnall@samba.org>2018-08-24 07:49:30 +0200
commite940e4cd48fa866cdb81e38d7786aac953f30bdf (patch)
tree27279c1cbc9c94799d50ba68b3c4b9168df6467b /python/samba
parentcabb299749388ebfda74571753e7b0209d32b266 (diff)
downloadsamba-e940e4cd48fa866cdb81e38d7786aac953f30bdf.tar.gz
PEP8: fix E711: comparison to None should be 'if cond is not None:'
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'python/samba')
-rw-r--r--python/samba/join.py2
-rw-r--r--python/samba/netcmd/delegation.py10
-rw-r--r--python/samba/tests/pam_winbind.py6
-rw-r--r--python/samba/tests/pam_winbind_warn_pwd_expire.py2
-rw-r--r--python/samba/tests/password_hash_gpgme.py4
5 files changed, 12 insertions, 12 deletions
diff --git a/python/samba/join.py b/python/samba/join.py
index ebcfea84444..66097b9c596 100644
--- a/python/samba/join.py
+++ b/python/samba/join.py
@@ -975,7 +975,7 @@ class DCJoinContext(object):
repl.replicate(ctx.new_krbtgt_dn, source_dsa_invocation_id,
destination_dsa_guid,
exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET, rodc=True)
- elif ctx.rid_manager_dn != None:
+ elif ctx.rid_manager_dn is not None:
# Try and get a RID Set if we can. This is only possible against the RID Master. Warn otherwise.
try:
repl.replicate(ctx.rid_manager_dn, source_dsa_invocation_id,
diff --git a/python/samba/netcmd/delegation.py b/python/samba/netcmd/delegation.py
index e0e281d3f7b..54ba71bdf41 100644
--- a/python/samba/netcmd/delegation.py
+++ b/python/samba/netcmd/delegation.py
@@ -56,7 +56,7 @@ class cmd_delegation_show(Command):
creds = credopts.get_credentials(lp)
paths = provision.provision_paths_from_lp(lp, lp.get("realm"))
- if H == None:
+ if H is None:
path = paths.samdb
else:
path = H
@@ -121,7 +121,7 @@ class cmd_delegation_for_any_service(Command):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
paths = provision.provision_paths_from_lp(lp, lp.get("realm"))
- if H == None:
+ if H is None:
path = paths.samdb
else:
path = H
@@ -174,7 +174,7 @@ class cmd_delegation_for_any_protocol(Command):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp, fallback_machine=True)
paths = provision.provision_paths_from_lp(lp, lp.get("realm"))
- if H == None:
+ if H is None:
path = paths.samdb
else:
path = H
@@ -219,7 +219,7 @@ class cmd_delegation_add_service(Command):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
paths = provision.provision_paths_from_lp(lp, lp.get("realm"))
- if H == None:
+ if H is None:
path = paths.samdb
else:
path = H
@@ -273,7 +273,7 @@ class cmd_delegation_del_service(Command):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
paths = provision.provision_paths_from_lp(lp, lp.get("realm"))
- if H == None:
+ if H is None:
path = paths.samdb
else:
path = H
diff --git a/python/samba/tests/pam_winbind.py b/python/samba/tests/pam_winbind.py
index 4ee7c8d784b..68b05b30d7d 100644
--- a/python/samba/tests/pam_winbind.py
+++ b/python/samba/tests/pam_winbind.py
@@ -32,7 +32,7 @@ class SimplePamTests(samba.tests.TestCase):
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
- self.assertTrue(res != None)
+ self.assertTrue(res is not None)
def test_authenticate_error(self):
domain = os.environ["DOMAIN"]
@@ -44,7 +44,7 @@ class SimplePamTests(samba.tests.TestCase):
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
- self.assertTrue(res != None)
+ self.assertTrue(res is not None)
# Authenticate again to check that we are not locked out with just one
# failed login
@@ -54,4 +54,4 @@ class SimplePamTests(samba.tests.TestCase):
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
- self.assertTrue(res != None)
+ self.assertTrue(res is not None)
diff --git a/python/samba/tests/pam_winbind_warn_pwd_expire.py b/python/samba/tests/pam_winbind_warn_pwd_expire.py
index 849099446da..df60bc5ace6 100644
--- a/python/samba/tests/pam_winbind_warn_pwd_expire.py
+++ b/python/samba/tests/pam_winbind_warn_pwd_expire.py
@@ -33,7 +33,7 @@ class PasswordExpirePamTests(samba.tests.TestCase):
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
- self.assertTrue(res != None)
+ self.assertTrue(res is not None)
if warn_pwd_expire == 0:
self.assertTrue(res.info == ())
elif warn_pwd_expire == 50:
diff --git a/python/samba/tests/password_hash_gpgme.py b/python/samba/tests/password_hash_gpgme.py
index 20c07e61967..42cd71d3e08 100644
--- a/python/samba/tests/password_hash_gpgme.py
+++ b/python/samba/tests/password_hash_gpgme.py
@@ -133,7 +133,7 @@ class PassWordHashGpgmeTests(PassWordHashTests):
sc = self.get_supplemental_creds()
if expect_cleartext:
(pos, ct_package) = get_package(sc, "Primary:CLEARTEXT")
- self.assertTrue(ct_package != None, "Failed to retrieve cleartext")
+ self.assertTrue(ct_package is not None, "Failed to retrieve cleartext")
# Check the clear-text value is correct.
ct = ndr_unpack(drsblobs.package_PrimaryCLEARTEXTBlob,
@@ -141,7 +141,7 @@ class PassWordHashGpgmeTests(PassWordHashTests):
self.assertEquals(password.encode('utf-16-le'), ct.cleartext)
else:
ct_package = get_package(sc, "Primary:CLEARTEXT")
- self.assertTrue(ct_package == None,
+ self.assertTrue(ct_package is None,
"Got cleartext when we shouldn't have")
def test_supplementalCredentials_cleartext_pso(self):