mirror of
https://github.com/samba-team/samba.git
synced 2025-07-23 20:59:10 +03:00
python:samba:netcmd: Fix code spelling
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andreas Schneider
parent
de2c4879ce
commit
e046986d04
@ -205,9 +205,9 @@ class Command(object):
|
||||
self.apply_colour_choice(kwargs.pop('color', 'auto'))
|
||||
|
||||
# Check for a min a max number of allowed arguments, whenever possible
|
||||
# The suffix "?" means zero or one occurence
|
||||
# The suffix "+" means at least one occurence
|
||||
# The suffix "*" means zero or more occurences
|
||||
# The suffix "?" means zero or one occurrence
|
||||
# The suffix "+" means at least one occurrence
|
||||
# The suffix "*" means zero or more occurrences
|
||||
min_args = 0
|
||||
max_args = 0
|
||||
undetermined_max_args = False
|
||||
|
@ -97,7 +97,7 @@ def netcmd_get_domain_infos_via_cldap(lp, creds, address=None):
|
||||
def is_printable_attr_val(val):
|
||||
import unicodedata
|
||||
|
||||
# The value must be convertable to a string value.
|
||||
# The value must be convertible to a string value.
|
||||
try:
|
||||
str_val = str(val)
|
||||
except:
|
||||
|
@ -68,7 +68,7 @@ class DnsConnWrapper:
|
||||
|
||||
dns_conn = DnsConnWrapper(server, lp, creds)
|
||||
|
||||
then various common errors (for example, mispelled zones) on
|
||||
then various common errors (for example, misspelled zones) on
|
||||
common operations will raise CommandErrors that turn into
|
||||
relatively nice messages (when compared to tracebacks).
|
||||
|
||||
|
@ -783,7 +783,7 @@ class cmd_domain_backup_rename(samba.netcmd.Command):
|
||||
# Updates the CN=<domain>,CN=Partitions,CN=Configuration,... object to
|
||||
# reflect the domain rename
|
||||
def rename_domain_partition(self, logger, samdb, new_netbios_name):
|
||||
'''Renames the domain parition object and updates its nETBIOSName'''
|
||||
'''Renames the domain partition object and updates its nETBIOSName'''
|
||||
|
||||
# lookup the crossRef object that holds the nETBIOSName (nCName has
|
||||
# already been updated by this point, but the netBIOS hasn't)
|
||||
|
@ -89,7 +89,7 @@ class cmd_domain_classicupgrade(Command):
|
||||
metavar="[yes|no|auto]",
|
||||
help="Define if we should use the native fs capabilities or a tdb file for "
|
||||
"storing attributes likes ntacl when --use-ntvfs is set. "
|
||||
"auto tries to make an inteligent guess based on the user rights and system capabilities",
|
||||
"auto tries to make an intelligent guess based on the user rights and system capabilities",
|
||||
default="auto")
|
||||
]
|
||||
if samba.is_ntvfs_fileserver_built():
|
||||
|
@ -128,7 +128,7 @@ class cmd_domain_provision(Command):
|
||||
metavar="[yes|no|auto]",
|
||||
help="Define if we should use the native fs capabilities or a tdb file for "
|
||||
"storing attributes likes ntacl when --use-ntvfs is set. "
|
||||
"auto tries to make an inteligent guess based on the user rights and system capabilities",
|
||||
"auto tries to make an intelligent guess based on the user rights and system capabilities",
|
||||
default="auto")
|
||||
]
|
||||
|
||||
@ -266,7 +266,7 @@ class cmd_domain_provision(Command):
|
||||
|
||||
if adprep_level is None:
|
||||
# Select the adprep_level default based
|
||||
# on what the base schema premits
|
||||
# on what the base schema permits
|
||||
if base_schema in ["2008_R2", "2008_R2_old"]:
|
||||
# without explicit --adprep-level=2008_R2
|
||||
# we will skip the adprep step on
|
||||
|
@ -1314,7 +1314,7 @@ class cmd_domain_trust_delete(DomainTrustCommand):
|
||||
if remote_lsa_info.sid != local_tdo_info.sid or \
|
||||
remote_lsa_info.name.string != local_tdo_info.netbios_name.string or \
|
||||
remote_lsa_info.dns_domain.string != local_tdo_info.domain_name.string:
|
||||
raise CommandError("LocalTDO inconsistend: Netbios[%s] DNS[%s] SID[%s]" % (
|
||||
raise CommandError("LocalTDO inconsistent: Netbios[%s] DNS[%s] SID[%s]" % (
|
||||
local_tdo_info.netbios_name.string,
|
||||
local_tdo_info.domain_name.string,
|
||||
local_tdo_info.sid))
|
||||
@ -1334,7 +1334,7 @@ class cmd_domain_trust_delete(DomainTrustCommand):
|
||||
if local_lsa_info.sid != remote_tdo_info.sid or \
|
||||
local_lsa_info.name.string != remote_tdo_info.netbios_name.string or \
|
||||
local_lsa_info.dns_domain.string != remote_tdo_info.domain_name.string:
|
||||
raise CommandError("RemoteTDO inconsistend: Netbios[%s] DNS[%s] SID[%s]" % (
|
||||
raise CommandError("RemoteTDO inconsistent: Netbios[%s] DNS[%s] SID[%s]" % (
|
||||
remote_tdo_info.netbios_name.string,
|
||||
remote_tdo_info.domain_name.string,
|
||||
remote_tdo_info.sid))
|
||||
|
@ -106,11 +106,11 @@ class cmd_drs_showrepl(Command):
|
||||
"from this server"),
|
||||
dest='format', action='store_const', const='summary'),
|
||||
Option("--pull-summary", help=("Have we successfully replicated "
|
||||
"from all relevent servers?"),
|
||||
"from all relevant servers?"),
|
||||
dest='format', action='store_const', const='pull_summary'),
|
||||
Option("--notify-summary", action='store_const',
|
||||
const='notify_summary', dest='format',
|
||||
help=("Have we successfully notified all relevent servers of "
|
||||
help=("Have we successfully notified all relevant servers of "
|
||||
"local changes, and did they say they successfully "
|
||||
"replicated?")),
|
||||
Option("--classic", help="print local replication details",
|
||||
|
@ -2815,7 +2815,8 @@ samba-tool gpo manage symlink add {31B2F340-016D-11D2-945F-00C04FB984F9} /tmp/so
|
||||
class cmd_remove_symlink(GPOCommand):
|
||||
"""Removes a VGP Symbolic Link Group Policy from the sysvol
|
||||
|
||||
This command removes a symlink setting from the sysvol from appling to winbind clients.
|
||||
This command removes a symlink setting from the sysvol from applying to winbind
|
||||
clients.
|
||||
|
||||
Example:
|
||||
samba-tool gpo manage symlink remove {31B2F340-016D-11D2-945F-00C04FB984F9} /tmp/source /tmp/target
|
||||
|
@ -278,7 +278,7 @@ class Descriptor(object):
|
||||
self.dacl_list.sort()
|
||||
|
||||
def extract_dacl(self):
|
||||
""" Extracts the DACL as a list of ACE string (with the brakets).
|
||||
""" Extracts the DACL as a list of ACE string (with the brackets).
|
||||
"""
|
||||
try:
|
||||
if "S:" in self.sddl:
|
||||
@ -876,7 +876,7 @@ class cmd_ldapcmp(Command):
|
||||
Option("-v", "--verbose", dest="verbose", action="store_true", default=False,
|
||||
help="Print all DN pairs that have been compared"),
|
||||
Option("--sd", dest="descriptor", action="store_true", default=False,
|
||||
help="Compare nTSecurityDescriptor attibutes only"),
|
||||
help="Compare nTSecurityDescriptor attributes only"),
|
||||
Option("--sort-aces", dest="sort_aces", action="store_true", default=False,
|
||||
help="Sort ACEs before comparison of nTSecurityDescriptor attribute"),
|
||||
Option("--view", dest="view", default="section", choices=["section", "collision"],
|
||||
@ -888,7 +888,7 @@ class cmd_ldapcmp(Command):
|
||||
Option("--scope", dest="scope", default="SUB", choices=["SUB", "ONE", "BASE"],
|
||||
help="Pass search scope that builds DN list. Options: SUB, ONE, BASE"),
|
||||
Option("--filter", dest="filter", default="",
|
||||
help="List of comma separated attributes to ignore in the comparision"),
|
||||
help="List of comma separated attributes to ignore in the comparison"),
|
||||
Option("--skip-missing-dn", dest="skip_missing_dn", action="store_true", default=False,
|
||||
help="Skip report and failure due to missing DNs in one server or another"),
|
||||
]
|
||||
|
@ -254,21 +254,21 @@ class cmd_listobjects(Command):
|
||||
except Exception as e:
|
||||
raise CommandError('Invalid ou_dn "%s": %s' % (ou_dn, e))
|
||||
|
||||
minchilds = 0
|
||||
minchildren = 0
|
||||
scope = ldb.SCOPE_ONELEVEL
|
||||
if recursive:
|
||||
minchilds = 1
|
||||
minchildren = 1
|
||||
scope = ldb.SCOPE_SUBTREE
|
||||
|
||||
try:
|
||||
childs = samdb.search(base=full_ou_dn,
|
||||
children = samdb.search(base=full_ou_dn,
|
||||
expression="(objectclass=*)",
|
||||
scope=scope, attrs=[])
|
||||
if len(childs) <= minchilds:
|
||||
if len(children) <= minchildren:
|
||||
self.outf.write('ou "%s" is empty\n' % ou_dn)
|
||||
return
|
||||
|
||||
for child in sorted(childs, key=attrgetter('dn')):
|
||||
for child in sorted(children, key=attrgetter('dn')):
|
||||
if child.dn == full_ou_dn:
|
||||
continue
|
||||
if not full_dn:
|
||||
|
@ -57,7 +57,7 @@ class cmd_schema_attribute_modify(Command):
|
||||
substring queries.
|
||||
fSUBTREEATTINDEX: create a browsing index for this attribute. VLV searches
|
||||
require this.
|
||||
fCONFIDENTIAL: indicate that the attribute is confidental and requires
|
||||
fCONFIDENTIAL: indicate that the attribute is confidential and requires
|
||||
special access checks.
|
||||
fNEVERVALUEAUDIT: indicate that changes to this value should NOT be audited.
|
||||
fRODCFILTEREDATTRIBUTE: indicate that this value should not be replicated to
|
||||
|
@ -2508,7 +2508,7 @@ samba-tool user syncpasswords --terminate \\
|
||||
def update_pid(pid):
|
||||
if self.lockfd != -1:
|
||||
got_exclusive = False
|
||||
# Try 5 times to get the exclusiv lock.
|
||||
# Try 5 times to get the exclusive lock.
|
||||
for i in range(0, 5):
|
||||
try:
|
||||
fcntl.lockf(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
@ -2665,7 +2665,7 @@ samba-tool user syncpasswords --terminate \\
|
||||
|
||||
for msg in notify_handle:
|
||||
if not isinstance(msg, ldb.Message):
|
||||
self.outf.write("referal: %s\n" % msg)
|
||||
self.outf.write("referral: %s\n" % msg)
|
||||
continue
|
||||
created = msg.get("uSNCreated")[0]
|
||||
changed = msg.get("uSNChanged")[0]
|
||||
@ -2726,11 +2726,11 @@ samba-tool user syncpasswords --terminate \\
|
||||
log_msg("No process running.\n")
|
||||
return
|
||||
if not conflict:
|
||||
log_msg("Proccess %d is not running anymore.\n" % (
|
||||
log_msg("Process %d is not running anymore.\n" % (
|
||||
self.current_pid))
|
||||
update_pid(None)
|
||||
return
|
||||
log_msg("Sending SIGTERM to proccess %d.\n" % (
|
||||
log_msg("Sending SIGTERM to process %d.\n" % (
|
||||
self.current_pid))
|
||||
os.kill(self.current_pid, signal.SIGTERM)
|
||||
return
|
||||
|
@ -151,7 +151,7 @@ class GraphCommand(Command):
|
||||
|
||||
def calc_distance_color_scheme(self, color_scheme, output):
|
||||
"""Heuristics to work out the colour scheme for distance matrices.
|
||||
Returning None means no colour, otherwise it sould be a colour
|
||||
Returning None means no colour, otherwise it should be a colour
|
||||
from graph.COLOUR_SETS"""
|
||||
if color_scheme is not None:
|
||||
# --color-scheme implies --color=yes for *this* purpose.
|
||||
|
Reference in New Issue
Block a user