Skip to content

Commit

Permalink
Showing 17 changed files with 204 additions and 286 deletions.
4 changes: 2 additions & 2 deletions python/samba/dbchecker.py
Original file line number Diff line number Diff line change
@@ -1455,8 +1455,8 @@ def fix_metadata(self, obj, attr):
object. This is used to fix missing replPropertyMetaData elements'''
guid_str = str(ndr_unpack(misc.GUID, obj['objectGUID'][0]))
dn = ldb.Dn(self.samdb, "<GUID=%s>" % guid_str)
res = self.samdb.search(base = dn, scope=ldb.SCOPE_BASE, attrs = [attr],
controls = ["search_options:1:2",
res = self.samdb.search(base=dn, scope=ldb.SCOPE_BASE, attrs=[attr],
controls=["search_options:1:2",
"show_recycled:1"])
msg = res[0]
nmsg = ldb.Message()
2 changes: 1 addition & 1 deletion python/samba/descriptor.py
Original file line number Diff line number Diff line change
@@ -524,7 +524,7 @@ def get_clean_sd(sd):
return sd_clean


def get_diff_sds(refsd, cursd, domainsid, checkSacl = True):
def get_diff_sds(refsd, cursd, domainsid, checkSacl=True):
"""Get the difference between 2 sd
This function split the textual representation of ACL into smaller
2 changes: 1 addition & 1 deletion python/samba/ms_schema.py
Original file line number Diff line number Diff line change
@@ -298,7 +298,7 @@ def __parse_schema_file(filename, objectClass):
return "\n\n".join(out)


def read_ms_schema(attr_file, classes_file, dump_attributes = True, dump_classes = True, debug = False):
def read_ms_schema(attr_file, classes_file, dump_attributes=True, dump_classes=True, debug=False):
"""Read WSPP documentation-derived schema files."""

attr_ldif = ""
2 changes: 1 addition & 1 deletion python/samba/netcmd/group.py
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ def run(self, groupname, credopts=None, sambaopts=None,
try:
samdb = SamDB(url=H, session_info=system_session(),
credentials=creds, lp=lp)
samdb.newgroup(groupname, groupou=groupou, grouptype = gtype,
samdb.newgroup(groupname, groupou=groupou, grouptype=gtype,
description=description, mailaddress=mail_address, notes=notes,
gidnumber=gid_number, nisdomain=nis_domain)
except Exception as e:
2 changes: 1 addition & 1 deletion python/samba/provision/sambadns.py
Original file line number Diff line number Diff line change
@@ -1251,7 +1251,7 @@ def setup_bind9_dns(samdb, secretsdb, names, paths, lp, logger,

create_named_txt(paths.namedtxt,
realm=names.realm, dnsdomain=names.dnsdomain,
dnsname = "%s.%s" % (names.hostname, names.dnsdomain),
dnsname="%s.%s" % (names.hostname, names.dnsdomain),
binddns_dir=paths.binddns_dir,
keytab_name=paths.dns_keytab)
logger.info("See %s for an example configuration include file for BIND",
2 changes: 1 addition & 1 deletion python/samba/tests/auth.py
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ def test_security_token(self):
self.assertTrue(self.admin_session.security_token.has_builtin_administrators())

def test_session_info_unix_details(self):
samba.auth.session_info_fill_unix(session_info = self.admin_session,
samba.auth.session_info_fill_unix(session_info=self.admin_session,
lp_ctx=self.lp,
user_name="Administrator")
self.assertEqual(self.admin_session.unix_info.sanitized_username,
2 changes: 1 addition & 1 deletion python/samba/tests/dcerpc/dnsserver.py
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ def setUp(self):
self.get_credentials())

self.samdb = SamDB(url="ldap://%s" % os.environ["DC_SERVER_IP"],
lp = self.get_loadparm(),
lp=self.get_loadparm(),
session_info=system_session(),
credentials=self.get_credentials())

186 changes: 93 additions & 93 deletions python/samba/tests/dcerpc/raw_protocol.py

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions python/samba/tests/dcerpc/raw_testcase.py
Original file line number Diff line number Diff line change
@@ -292,7 +292,7 @@ def do_single_request(self, call_id, ctx, io,
allow_remaining=False,
send_req=True,
recv_rep=True,
fault_pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
fault_pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
fault_status=None,
fault_context_id=None,
@@ -637,9 +637,9 @@ def parse_auth(self, auth_info, ndr_print=None, hexdump=None):
def generate_pdu(self, ptype, call_id, payload,
rpc_vers=5,
rpc_vers_minor=0,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
drep = [samba.dcerpc.dcerpc.DCERPC_DREP_LE, 0, 0, 0],
drep=[samba.dcerpc.dcerpc.DCERPC_DREP_LE, 0, 0, 0],
ndr_print=None, hexdump=None):

if getattr(payload, 'auth_info', None):
@@ -669,9 +669,9 @@ def generate_pdu(self, ptype, call_id, payload,
def verify_pdu(self, p, ptype, call_id,
rpc_vers=5,
rpc_vers_minor=0,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
drep = [samba.dcerpc.dcerpc.DCERPC_DREP_LE, 0, 0, 0],
drep=[samba.dcerpc.dcerpc.DCERPC_DREP_LE, 0, 0, 0],
auth_length=None):

self.assertIsNotNone(p, "No valid pdu")
@@ -700,7 +700,7 @@ def verify_pdu(self, p, ptype, call_id,
return

def generate_bind(self, call_id,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
max_xmit_frag=5840,
max_recv_frag=5840,
@@ -726,7 +726,7 @@ def generate_bind(self, call_id,
return p

def generate_alter(self, call_id,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
max_xmit_frag=5840,
max_recv_frag=5840,
@@ -752,7 +752,7 @@ def generate_alter(self, call_id,
return p

def generate_auth3(self, call_id,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
auth_info="",
ndr_print=None, hexdump=None):
@@ -769,7 +769,7 @@ def generate_auth3(self, call_id,
return p

def generate_request(self, call_id,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
alloc_hint=None,
context_id=None,
@@ -802,7 +802,7 @@ def generate_request(self, call_id,
return p

def generate_co_cancel(self, call_id,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
auth_info="",
ndr_print=None, hexdump=None):
@@ -819,7 +819,7 @@ def generate_co_cancel(self, call_id,
return p

def generate_orphaned(self, call_id,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
auth_info="",
ndr_print=None, hexdump=None):
@@ -836,7 +836,7 @@ def generate_orphaned(self, call_id,
return p

def generate_shutdown(self, call_id,
pfc_flags = samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
pfc_flags=samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_FIRST |
samba.dcerpc.dcerpc.DCERPC_PFC_FLAG_LAST,
ndr_print=None, hexdump=None):

4 changes: 2 additions & 2 deletions python/samba/tests/docs.py
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ def test_default_s3(self):

# registry shares appears to need sudo
self._set_arbitrary(['bin/testparm'],
exceptions = ['client lanman auth',
exceptions=['client lanman auth',
'client plaintext auth',
'registry shares',
'smb ports',
@@ -170,7 +170,7 @@ def test_default_s4(self):
self._test_default(['bin/samba-tool', 'testparm'])
self._set_defaults(['bin/samba-tool', 'testparm'])
self._set_arbitrary(['bin/samba-tool', 'testparm'],
exceptions = ['smb ports',
exceptions=['smb ports',
'rpc server dynamic port range',
'name resolve order'])
self._test_empty(['bin/samba-tool', 'testparm'])
4 changes: 2 additions & 2 deletions python/samba/tests/samba_tool/user_virtualCryptSHA.py
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest):
def setUp(self):
super(UserCmdCryptShaTestCase, self).setUp()

def add_user(self, hashes = ""):
def add_user(self, hashes=""):
self.lp = samba.tests.env_loadparm()

# set the extra hashes to be calculated
@@ -92,7 +92,7 @@ def tearDown(self):
super(UserCmdCryptShaTestCase, self).tearDown()
self.runsubcmd("user", "delete", USER_NAME)

def _get_password(self, attributes, decrypt = False):
def _get_password(self, attributes, decrypt=False):
command = ["user",
"getpassword",
USER_NAME,
2 changes: 1 addition & 1 deletion python/samba/upgrade.py
Original file line number Diff line number Diff line change
@@ -730,7 +730,7 @@ def upgrade_from_samba3(samba3, logger, targetdir, session_info=None,
result = provision(logger, session_info,
targetdir=targetdir, realm=realm, domain=domainname,
domainsid=domainsid, next_rid=next_rid,
dc_rid=machinerid, adminpass = adminpass,
dc_rid=machinerid, adminpass=adminpass,
dom_for_fun_level=dsdb.DS_DOMAIN_FUNCTION_2003,
hostname=netbiosname.lower(), machinepass=machinepass,
serverrole=serverrole, samdb_fill=FILL_FULL,
6 changes: 3 additions & 3 deletions script/autobuild.py
Original file line number Diff line number Diff line change
@@ -635,7 +635,7 @@ def write_pidfile(fname):
f.close()


def rebase_tree(rebase_url, rebase_branch = "master"):
def rebase_tree(rebase_url, rebase_branch="master"):
rebase_remote = "rebaseon"
do_print("Rebasing on %s" % rebase_url)
run_cmd("git describe HEAD", show=True, dir=test_master)
@@ -666,7 +666,7 @@ def rebase_tree(rebase_url, rebase_branch = "master"):
(rebase_remote, rebase_branch),
show=True, dir=test_master)

def push_to(push_url, push_branch = "master"):
def push_to(push_url, push_branch="master"):
push_remote = "pushto"
do_print("Pushing to %s" % push_url)
if options.mark:
@@ -735,7 +735,7 @@ def send_email(subject, text, log_tar):
outer['Subject'] = subject
outer['To'] = options.email
outer['From'] = options.email_from
outer['Date'] = email.utils.formatdate(localtime = True)
outer['Date'] = email.utils.formatdate(localtime=True)
outer.preamble = 'Autobuild mails are now in MIME because we optionally attach the logs.\n'
outer.attach(MIMEText(text, 'plain'))
if options.attach_logs:
2 changes: 1 addition & 1 deletion script/generate_param.py
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@
parser.add_option("--mode", type="choice", metavar="<FUNCTIONS|S3PROTO|LIBPROTO|PARAMDEFS|PARAMTABLE>",
choices=["FUNCTIONS", "S3PROTO", "LIBPROTO", "PARAMDEFS", "PARAMTABLE"], default="FUNCTIONS")
parser.add_option("--scope", metavar="<GLOBAL|LOCAL>",
choices = ["GLOBAL", "LOCAL"], default="GLOBAL")
choices=["GLOBAL", "LOCAL"], default="GLOBAL")

(options, args) = parser.parse_args()

Loading

0 comments on commit 1ccc36b

Please sign in to comment.