summaryrefslogtreecommitdiff
path: root/python/samba
diff options
context:
space:
mode:
Diffstat (limited to 'python/samba')
-rw-r--r--python/samba/gpclass.py2
-rw-r--r--python/samba/ms_schema.py4
-rw-r--r--python/samba/netcmd/domain.py6
-rw-r--r--python/samba/netcmd/ldapcmp.py4
-rw-r--r--python/samba/netcmd/user.py4
-rw-r--r--python/samba/samba3/__init__.py4
-rw-r--r--python/samba/tests/dcerpc/dnsserver.py2
-rw-r--r--python/samba/tests/dcerpc/registry.py2
-rw-r--r--python/samba/tests/dcerpc/srvsvc.py2
-rw-r--r--python/samba/tests/dcerpc/testrpc.py2
-rw-r--r--python/samba/tests/kcc/__init__.py2
-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/samba_tool/dnscmd.py6
-rw-r--r--python/samba/tests/samba_tool/sites.py8
-rw-r--r--python/samba/upgrade.py4
16 files changed, 30 insertions, 30 deletions
diff --git a/python/samba/gpclass.py b/python/samba/gpclass.py
index eb622b1c967..0cadcd45fc7 100644
--- a/python/samba/gpclass.py
+++ b/python/samba/gpclass.py
@@ -507,7 +507,7 @@ def unapply_gp(lp, creds, test_ldb, logger, store, gp_extensions):
unapply_attributes = gp_db.list(gp_extensions)
for attr in unapply_attributes:
attr_obj = attr[-1](logger, test_ldb, gp_db, lp, attr[0], attr[1])
- attr_obj.mapper()[attr[0]][0](attr[1]) # Set the old value
+ attr_obj.mapper()[attr[0]][0](attr[1]) # Set the old value
gp_db.delete(str(attr_obj), attr[0])
gp_db.commit()
diff --git a/python/samba/ms_schema.py b/python/samba/ms_schema.py
index 21e91d311ab..850bdca3ae5 100644
--- a/python/samba/ms_schema.py
+++ b/python/samba/ms_schema.py
@@ -36,14 +36,14 @@ bitFields["searchflags"] = {
'fTUPLEINDEX': 26, # TP
'fSUBTREEATTINDEX': 25, # ST
'fCONFIDENTIAL': 24, # CF
- 'fCONFIDENTAIL': 24, # typo
+ 'fCONFIDENTAIL': 24, # typo
'fNEVERVALUEAUDIT': 23, # NV
'fRODCAttribute': 22, # RO
# missing in ADTS but required by LDIF
'fRODCFilteredAttribute': 22, # RO
- 'fRODCFILTEREDATTRIBUTE': 22, # case
+ 'fRODCFILTEREDATTRIBUTE': 22, # case
'fEXTENDEDLINKTRACKING': 21, # XL
'fBASEONLY': 20, # BO
'fPARTITIONSECRET': 19, # SE
diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py
index 40117251450..889aa922eac 100644
--- a/python/samba/netcmd/domain.py
+++ b/python/samba/netcmd/domain.py
@@ -1057,7 +1057,7 @@ class cmd_domain_level(Command):
takes_options = [
Option("-H", "--URL", help="LDB URL for database or target server", type=str,
metavar="URL", dest="H"),
- Option("-q", "--quiet", help="Be quiet", action="store_true"), # unused
+ Option("-q", "--quiet", help="Be quiet", action="store_true"), # unused
Option("--forest-level", type="choice", choices=["2003", "2008", "2008_R2", "2012", "2012_R2"],
help="The forest function level (2003 | 2008 | 2008_R2 | 2012 | 2012_R2)"),
Option("--domain-level", type="choice", choices=["2003", "2008", "2008_R2", "2012", "2012_R2"],
@@ -1364,7 +1364,7 @@ class cmd_domain_passwordsettings_set(Command):
takes_options = [
Option("-H", "--URL", help="LDB URL for database or target server", type=str,
metavar="URL", dest="H"),
- Option("-q", "--quiet", help="Be quiet", action="store_true"), # unused
+ Option("-q", "--quiet", help="Be quiet", action="store_true"), # unused
Option("--complexity", type="choice", choices=["on", "off", "default"],
help="The password complexity (on | off | default). Default is 'on'"),
Option("--store-plaintext", type="choice", choices=["on", "off", "default"],
@@ -4028,7 +4028,7 @@ class cmd_domain_schema_upgrade(Command):
takes_options = [
Option("-H", "--URL", help="LDB URL for database or target server", type=str,
metavar="URL", dest="H"),
- Option("-q", "--quiet", help="Be quiet", action="store_true"), #unused
+ Option("-q", "--quiet", help="Be quiet", action="store_true"), # unused
Option("-v", "--verbose", help="Be verbose", action="store_true"),
Option("--schema", type="choice", metavar="SCHEMA",
choices=["2012", "2012_R2"],
diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py
index 3f4d63d989f..3b0e0d536cf 100644
--- a/python/samba/netcmd/ldapcmp.py
+++ b/python/samba/netcmd/ldapcmp.py
@@ -439,7 +439,7 @@ class LDAPObject(object):
"uSNChanged",
"uSNCreated",
"uSNLastObjRem",
- "whenChanged", # This is implicitly replicated, but may diverge on updates of non-replicated attributes
+ "whenChanged", # This is implicitly replicated, but may diverge on updates of non-replicated attributes
]
self.ignore_attributes = self.non_replicated_attributes
self.ignore_attributes += ["msExchServer1HighestUSN"]
@@ -677,7 +677,7 @@ class LDAPObject(object):
self.summary["unique_attrs"] += self.unique_attrs
self.summary["df_value_attrs"] += self.df_value_attrs
other.summary["unique_attrs"] += other.unique_attrs
- other.summary["df_value_attrs"] += self.df_value_attrs # they are the same
+ other.summary["df_value_attrs"] += self.df_value_attrs # they are the same
#
self.screen_output = res[:-1]
other.screen_output = res[:-1]
diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py
index 677e0a91559..ab00a07b8f6 100644
--- a/python/samba/netcmd/user.py
+++ b/python/samba/netcmd/user.py
@@ -2202,7 +2202,7 @@ samba-tool user syncpasswords --terminate \\
if pid == 0:
os.setsid()
pid = os.fork()
- if pid == 0: # Actual daemon
+ if pid == 0: # Actual daemon
pid = os.getpid()
log_msg("Daemonized as pid %d (from %d)\n" % (pid, orig_pid))
load_cache()
@@ -2220,7 +2220,7 @@ samba-tool user syncpasswords --terminate \\
import resource # Resource usage information.
maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
if maxfd == resource.RLIM_INFINITY:
- maxfd = 1024 # Rough guess at maximum number of open file descriptors.
+ maxfd = 1024 # Rough guess at maximum number of open file descriptors.
logfd = os.open(logfile, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o600)
self.outf.write("Using logfile[%s]\n" % logfile)
for fd in range(0, maxfd):
diff --git a/python/samba/samba3/__init__.py b/python/samba/samba3/__init__.py
index 950b3c28479..283185aa823 100644
--- a/python/samba/samba3/__init__.py
+++ b/python/samba/samba3/__init__.py
@@ -324,7 +324,7 @@ class WinsDatabase(object):
f = open(file, 'r')
assert f.readline().rstrip("\n") == "VERSION 1 0"
for l in f.readlines():
- if l[0] == "#": # skip comments
+ if l[0] == "#": # skip comments
continue
entries = shellsplit(l.rstrip("\n"))
name = entries[0]
@@ -352,7 +352,7 @@ class WinsDatabase(object):
"""Return the entries in this WINS database."""
return self.entries.items()
- def close(self): # for consistency
+ def close(self): # for consistency
pass
diff --git a/python/samba/tests/dcerpc/dnsserver.py b/python/samba/tests/dcerpc/dnsserver.py
index c45d81e69fb..e0fff73ad78 100644
--- a/python/samba/tests/dcerpc/dnsserver.py
+++ b/python/samba/tests/dcerpc/dnsserver.py
@@ -172,7 +172,7 @@ class DnsserverTests(RpcInterfaceTestCase):
self.add_record(self.custom_zone, "testrecord", record_type_str, record_str)
dn, record = self.get_record_from_db(self.custom_zone, "testrecord")
- record.rank = 0 # DNS_RANK_NONE
+ record.rank = 0 # DNS_RANK_NONE
res = self.samdb.dns_replace_by_dn(dn, [record])
if res is not None:
self.fail("Unable to update dns record to have DNS_RANK_NONE.")
diff --git a/python/samba/tests/dcerpc/registry.py b/python/samba/tests/dcerpc/registry.py
index 95de0d0703f..279eeb1cc82 100644
--- a/python/samba/tests/dcerpc/registry.py
+++ b/python/samba/tests/dcerpc/registry.py
@@ -47,5 +47,5 @@ class WinregTests(RpcInterfaceTestCase):
handle = self.conn.OpenHKLM(None,
winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
x = self.conn.QueryInfoKey(handle, winreg.String())
- self.assertEquals(9, len(x)) # should return a 9-tuple
+ self.assertEquals(9, len(x)) # should return a 9-tuple
self.conn.CloseKey(handle)
diff --git a/python/samba/tests/dcerpc/srvsvc.py b/python/samba/tests/dcerpc/srvsvc.py
index a3e60757483..4590ca5a412 100644
--- a/python/samba/tests/dcerpc/srvsvc.py
+++ b/python/samba/tests/dcerpc/srvsvc.py
@@ -40,7 +40,7 @@ class SrvsvcTests(RpcInterfaceTestCase):
share.current_users = 0x00000000
share.max_users = -1
share.password = None
- share.path = u'C:\\tmp' # some random path
+ share.path = u'C:\\tmp' # some random path
share.permissions = 123434566
return share
diff --git a/python/samba/tests/dcerpc/testrpc.py b/python/samba/tests/dcerpc/testrpc.py
index 5aadcf48eed..f8191ba2dbe 100644
--- a/python/samba/tests/dcerpc/testrpc.py
+++ b/python/samba/tests/dcerpc/testrpc.py
@@ -109,7 +109,7 @@ class RpcTests(object):
print("ERROR: Failed to check_type %s.%s: %r: %s" % (iname, n, e.__class__, e))
self.errcount += 1
elif callable(value):
- pass # Method
+ pass # Method
else:
print("UNKNOWN: %s=%s" % (n, value))
if self.errcount - errcount != 0:
diff --git a/python/samba/tests/kcc/__init__.py b/python/samba/tests/kcc/__init__.py
index ee09a78689a..b2518022805 100644
--- a/python/samba/tests/kcc/__init__.py
+++ b/python/samba/tests/kcc/__init__.py
@@ -35,7 +35,7 @@ from samba.credentials import Credentials
from samba.samdb import SamDB
unix_now = int(time.time())
-unix_once_upon_a_time = 1000000000 #2001-09-09
+unix_once_upon_a_time = 1000000000 # 2001-09-09
ENV_DSAS = {
'ad_dc_ntvfs': ['CN=LOCALDC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=samba,DC=example,DC=com'],
diff --git a/python/samba/tests/pam_winbind.py b/python/samba/tests/pam_winbind.py
index d64600e8566..0f38469da0b 100644
--- a/python/samba/tests/pam_winbind.py
+++ b/python/samba/tests/pam_winbind.py
@@ -26,7 +26,7 @@ class SimplePamTests(samba.tests.TestCase):
username = os.environ["USERNAME"]
password = os.environ["PASSWORD"]
unix_username = "%s/%s" % (domain, username)
- expected_rc = 0 # PAM_SUCCESS
+ expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
@@ -38,7 +38,7 @@ class SimplePamTests(samba.tests.TestCase):
username = os.environ["USERNAME"]
password = "WrongPassword"
unix_username = "%s/%s" % (domain, username)
- expected_rc = 7 # PAM_AUTH_ERR
+ expected_rc = 7 # PAM_AUTH_ERR
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
@@ -48,7 +48,7 @@ class SimplePamTests(samba.tests.TestCase):
# Authenticate again to check that we are not locked out with just one
# failed login
password = os.environ["PASSWORD"]
- expected_rc = 0 # PAM_SUCCESS
+ expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
diff --git a/python/samba/tests/pam_winbind_warn_pwd_expire.py b/python/samba/tests/pam_winbind_warn_pwd_expire.py
index c573657c4dd..c3b7e1dbfca 100644
--- a/python/samba/tests/pam_winbind_warn_pwd_expire.py
+++ b/python/samba/tests/pam_winbind_warn_pwd_expire.py
@@ -27,7 +27,7 @@ class PasswordExpirePamTests(samba.tests.TestCase):
password = os.environ["PASSWORD"]
warn_pwd_expire = int(os.environ["WARN_PWD_EXPIRE"])
unix_username = "%s/%s" % (domain, username)
- expected_rc = 0 # PAM_SUCCESS
+ expected_rc = 0 # PAM_SUCCESS
tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
diff --git a/python/samba/tests/samba_tool/dnscmd.py b/python/samba/tests/samba_tool/dnscmd.py
index 9bbc65827c5..ccd7e8f2c1e 100644
--- a/python/samba/tests/samba_tool/dnscmd.py
+++ b/python/samba/tests/samba_tool/dnscmd.py
@@ -171,7 +171,7 @@ class DnsCmdTestCase(SambaToolCmdTest):
% (record_str, record_type_str))
dn, record = self.get_record_from_db(self.zone, "testrecord")
- record.rank = 0 # DNS_RANK_NONE
+ record.rank = 0 # DNS_RANK_NONE
res = self.samdb.dns_replace_by_dn(dn, [record])
if res is not None:
self.fail("Unable to update dns record to have DNS_RANK_NONE.")
@@ -386,7 +386,7 @@ class DnsCmdTestCase(SambaToolCmdTest):
try:
self.assertCmdFail(result)
except AssertionError:
- continue # Don't check this one, because record2 _is_ a valid entry of dnstype1.
+ continue # Don't check this one, because record2 _is_ a valid entry of dnstype1.
# Check both ways: Give the current type and try to update,
# and give the new type and try to update.
@@ -484,7 +484,7 @@ class DnsCmdTestCase(SambaToolCmdTest):
# we can't enter the wrong current value for a given record.
for dnstype in self.good_records:
if len(self.good_records[dnstype]) < 3:
- continue # Not enough records of this type to do this test
+ continue # Not enough records of this type to do this test
used_record = self.good_records[dnstype][0]
unused_record = self.good_records[dnstype][1]
diff --git a/python/samba/tests/samba_tool/sites.py b/python/samba/tests/samba_tool/sites.py
index 228f28d9272..89197f7764a 100644
--- a/python/samba/tests/samba_tool/sites.py
+++ b/python/samba/tests/samba_tool/sites.py
@@ -77,9 +77,9 @@ class SitesSubnetCmdTestCase(BaseSitesCmdTestCase):
def test_site_subnet_create(self):
cidrs = (("10.9.8.0/24", self.sitename),
("50.60.0.0/16", self.sitename2),
- ("50.61.0.0/16", self.sitename2), # second subnet on the site
- ("50.0.0.0/8", self.sitename), # overlapping subnet, other site
- ("50.62.1.2/32", self.sitename), # single IP
+ ("50.61.0.0/16", self.sitename2), # second subnet on the site
+ ("50.0.0.0/8", self.sitename), # overlapping subnet, other site
+ ("50.62.1.2/32", self.sitename), # single IP
("aaaa:bbbb:cccc:dddd:eeee:ffff:2222:1100/120",
self.sitename2),
)
@@ -114,7 +114,7 @@ class SitesSubnetCmdTestCase(BaseSitesCmdTestCase):
def test_site_subnet_create_should_fail(self):
cidrs = (("10.9.8.0/33", self.sitename), # mask too big
("50.60.0.0/8", self.sitename2), # insufficient zeros
- ("50.261.0.0/16", self.sitename2), # bad octet
+ ("50.261.0.0/16", self.sitename2), # bad octet
("7.0.0.0.0/0", self.sitename), # insufficient zeros
("aaaa:bbbb:cccc:dddd:eeee:ffff:2222:1100/119",
self.sitename), # insufficient zeros
diff --git a/python/samba/upgrade.py b/python/samba/upgrade.py
index c340575b2c2..2e17f186a95 100644
--- a/python/samba/upgrade.py
+++ b/python/samba/upgrade.py
@@ -351,9 +351,9 @@ def import_wins(samba4_winsdb, samba3_winsdb):
rType = 0x0
if ttl > time.time():
- rState = 0x0 # active
+ rState = 0x0 # active
else:
- rState = 0x1 # released
+ rState = 0x1 # released
nType = ((nb_flags & 0x60) >> 5)