class ARecord(dnsserver.DNS_RPC_RECORD):
def __init__(self, ip_addr, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE,
node_flag=0):
- super(ARecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_A
self.dwFlags = rank | node_flag
self.dwSerial = serial
def __init__(self, ip6_addr, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE,
node_flag=0):
- super(AAAARecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_AAAA
self.dwFlags = rank | node_flag
self.dwSerial = serial
def __init__(self, ptr, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE,
node_flag=0):
- super(PTRRecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_PTR
self.dwFlags = rank | node_flag
self.dwSerial = serial
def __init__(self, dns_server, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE,
node_flag=0):
- super(NSRecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_NS
self.dwFlags = rank | node_flag
self.dwSerial = serial
def __init__(self, mail_server, preference, serial=1, ttl=900,
rank=dnsp.DNS_RANK_ZONE, node_flag=0):
- super(MXRecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_MX
self.dwFlags = rank | node_flag
self.dwSerial = serial
def __init__(self, mname, rname, serial=1, refresh=900, retry=600,
expire=86400, minimum=3600, ttl=3600, rank=dnsp.DNS_RANK_ZONE,
node_flag=dnsp.DNS_RPC_FLAG_AUTH_ZONE_ROOT):
- super(SOARecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_SOA
self.dwFlags = rank | node_flag
self.dwSerial = serial
def __init__(self, target, port, priority=0, weight=100, serial=1, ttl=900,
rank=dnsp.DNS_RANK_ZONE, node_flag=0):
- super(SRVRecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_SRV
self.dwFlags = rank | node_flag
self.dwSerial = serial
def __init__(self, slist, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE,
node_flag=0):
- super(TXTRecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_TXT
self.dwFlags = rank | node_flag
self.dwSerial = serial
def __init__(self, binding_string, lp, creds, samdb, invocation_id,
old_base_dn, new_base_dn):
- super(drs_ReplicateRenamer, self).__init__(binding_string, lp, creds,
- samdb, invocation_id)
+ super().__init__(binding_string, lp, creds, samdb, invocation_id)
self.old_base_dn = old_base_dn
self.new_base_dn = new_base_dn
self.rename_top_level_object(ctr.first_object.object)
# then do the normal repl processing to apply this chunk to our DB
- super(drs_ReplicateRenamer, self).process_chunk(level, ctr, schema,
- req_level, req,
- first_chunk)
+ super().process_chunk(level, ctr, schema, req_level, req, first_chunk)
def parse(self, contents):
try:
- super(GPTIniParser, self).parse(contents)
+ super().parse(contents)
except UnicodeDecodeError:
# Required dict_type in Python 2.7
self.ini_conf = ConfigParser(dict_type=collections.OrderedDict,
class GPScriptsIniParser(GPIniParser):
def build_xml_parameter(self, section_xml, section, key_ini, val_ini):
- parent_return = super(GPScriptsIniParser,
- self).build_xml_parameter(section_xml, section,
- key_ini, val_ini)
+ parent_return = super().build_xml_parameter(section_xml, section,
+ key_ini, val_ini)
cmdline = re.match('\\d+CmdLine$', key_ini)
if cmdline is not None:
class GPFDeploy1IniParser(GPIniParser):
def build_xml_parameter(self, section_xml, section, key_ini, val_ini):
- parent_return = super(GPFDeploy1IniParser,
- self).build_xml_parameter(section_xml, section,
- key_ini, val_ini)
+ parent_return = super().build_xml_parameter(section_xml, section,
+ key_ini, val_ini)
# Add generalization metadata and parse out SID list
if section.lower() == 'folder_redirection':
# Process the header section
return (key, value)
# Do the normal ini code for other sections
- return super(GPFDeploy1IniParser,
- self).load_xml_parameter(param_xml, section)
+ return super().load_xml_parameter(param_xml, section)
def build_xml_section(self, root_xml, sec_ini):
section = SubElement(root_xml, 'Section')
if url is None:
url = lp.private_path("idmap.ldb")
- super(IDmapDB, self).__init__(url=url, lp=lp, modules_dir=modules_dir,
- session_info=session_info, credentials=credentials, flags=flags,
- options=options)
+ super().__init__(url=url, lp=lp, modules_dir=modules_dir,
+ session_info=session_info, credentials=credentials, flags=flags,
+ options=options)
def connect(self, url=None, flags=0, options=None):
- super(IDmapDB, self).connect(url=self.lp.private_path(url), flags=flags,
- options=options)
+ super().connect(url=self.lp.private_path(url), flags=flags,
+ options=options)
def increment_xid(self):
"""Increment xidNumber, if not present it create and assign it to the lowerBound
class DCJoinException(Exception):
def __init__(self, msg):
- super(DCJoinException, self).__init__("Can't join, error: %s" % msg)
+ super().__init__("Can't join, error: %s" % msg)
class DCJoinContext(object):
targetdir=None, domain=None, dns_backend=None,
include_secrets=False, backend_store=None,
backend_store_size=None):
- super(DCCloneContext, ctx).__init__(logger, server, creds, lp,
- targetdir=targetdir, domain=domain,
- dns_backend=dns_backend,
- backend_store=backend_store,
- backend_store_size=backend_store_size)
+ super().__init__(logger, server, creds, lp,
+ targetdir=targetdir, domain=domain,
+ dns_backend=dns_backend,
+ backend_store=backend_store,
+ backend_store_size=backend_store_size)
# As we don't want to create or delete these DNs, we set them to None
ctx.server_dn = None
def __init__(ctx, new_base_dn, new_domain_name, new_realm, logger=None,
server=None, creds=None, lp=None, targetdir=None, domain=None,
dns_backend=None, include_secrets=True, backend_store=None):
- super(DCCloneAndRenameContext, ctx).__init__(logger, server, creds, lp,
- targetdir=targetdir,
- domain=domain,
- dns_backend=dns_backend,
- include_secrets=include_secrets,
- backend_store=backend_store)
+ super().__init__(logger, server, creds, lp,
+ targetdir=targetdir,
+ domain=domain,
+ dns_backend=dns_backend,
+ include_secrets=include_secrets,
+ backend_store=backend_store)
# store the new DN (etc) that we want the cloned DB to use
ctx.new_base_dn = new_base_dn
ctx.new_domain_name = new_domain_name
"""Add color to log according to level"""
def format(self, record):
- log = super(ColoredFormatter, self).format(record)
+ log = super().format(record)
color = LEVEL_COLORS.get(record.levelno, GREY)
return color + log + C_NORMAL
dtd_header += '\n]>\n'
- super(cmd_restore, self).run(displayname, H, tmpdir, sambaopts,
- credopts, versionopts)
+ super().run(displayname, H, tmpdir, sambaopts, credopts, versionopts)
try:
if tmpdir is None:
class GetPasswordCommand(Command):
def __init__(self):
- super(GetPasswordCommand, self).__init__()
+ super().__init__()
self.lp = None
def inject_virtual_attributes(self, samdb):
"""A specified name was not a valid NetBIOS name."""
def __init__(self, name):
- super(InvalidNetbiosName, self).__init__(
+ super().__init__(
"The name '%r' is not a valid NetBIOS name" % name)
class MissingShareError(ProvisioningError):
def __init__(self, name, smbconf):
- super(MissingShareError, self).__init__(
+ super().__init__(
"Existing smb.conf does not have a [%s] share, but you are "
"configuring a DC. Please remove %s or add the share manually." %
(name, smbconf))
class ARecord(dnsp.DnssrvRpcRecord):
def __init__(self, ip_addr, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE):
- super(ARecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_A
self.rank = rank
self.dwSerial = serial
class AAAARecord(dnsp.DnssrvRpcRecord):
def __init__(self, ip6_addr, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE):
- super(AAAARecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_AAAA
self.rank = rank
self.dwSerial = serial
class NSRecord(dnsp.DnssrvRpcRecord):
def __init__(self, dns_server, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE):
- super(NSRecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_NS
self.rank = rank
self.dwSerial = serial
def __init__(self, mname, rname, serial=1, refresh=900, retry=600,
expire=86400, minimum=3600, ttl=3600, rank=dnsp.DNS_RANK_ZONE):
- super(SOARecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_SOA
self.rank = rank
self.dwSerial = serial
def __init__(self, target, port, priority=0, weight=100, serial=1, ttl=900,
rank=dnsp.DNS_RANK_ZONE):
- super(SRVRecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_SRV
self.rank = rank
self.dwSerial = serial
class TXTRecord(dnsp.DnssrvRpcRecord):
def __init__(self, slist, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE):
- super(TXTRecord, self).__init__()
+ super().__init__()
self.wType = dnsp.DNS_TYPE_TXT
self.rank = rank
self.dwSerial = serial
class TypeProperty(dnsp.DnsProperty):
def __init__(self, zone_type=dnsp.DNS_ZONE_TYPE_PRIMARY):
- super(TypeProperty, self).__init__()
+ super().__init__()
self.wDataLength = 1
self.version = 1
self.id = dnsp.DSPROPERTY_ZONE_TYPE
class AllowUpdateProperty(dnsp.DnsProperty):
def __init__(self, allow_update=dnsp.DNS_ZONE_UPDATE_SECURE):
- super(AllowUpdateProperty, self).__init__()
+ super().__init__()
self.wDataLength = 1
self.version = 1
self.id = dnsp.DSPROPERTY_ZONE_ALLOW_UPDATE
class SecureTimeProperty(dnsp.DnsProperty):
def __init__(self, secure_time=0):
- super(SecureTimeProperty, self).__init__()
+ super().__init__()
self.wDataLength = 1
self.version = 1
self.id = dnsp.DSPROPERTY_ZONE_SECURE_TIME
class NorefreshIntervalProperty(dnsp.DnsProperty):
def __init__(self, norefresh_interval=0):
- super(NorefreshIntervalProperty, self).__init__()
+ super().__init__()
self.wDataLength = 1
self.version = 1
self.id = dnsp.DSPROPERTY_ZONE_NOREFRESH_INTERVAL
class RefreshIntervalProperty(dnsp.DnsProperty):
def __init__(self, refresh_interval=0):
- super(RefreshIntervalProperty, self).__init__()
+ super().__init__()
self.wDataLength = 1
self.version = 1
self.id = dnsp.DSPROPERTY_ZONE_REFRESH_INTERVAL
class AgingStateProperty(dnsp.DnsProperty):
def __init__(self, aging_enabled=0):
- super(AgingStateProperty, self).__init__()
+ super().__init__()
self.wDataLength = 1
self.version = 1
self.id = dnsp.DSPROPERTY_ZONE_AGING_STATE
class AgingEnabledTimeProperty(dnsp.DnsProperty):
def __init__(self, next_cycle_hours=0):
- super(AgingEnabledTimeProperty, self).__init__()
+ super().__init__()
self.wDataLength = 1
self.version = 1
self.id = dnsp.DSPROPERTY_ZONE_AGING_ENABLED_TIME
self.url = url
- super(SamDB, self).__init__(url=url, lp=lp, modules_dir=modules_dir,
- session_info=session_info, credentials=credentials, flags=flags,
- options=options)
+ super().__init__(url=url, lp=lp, modules_dir=modules_dir,
+ session_info=session_info, credentials=credentials, flags=flags,
+ options=options)
if global_schema:
dsdb._dsdb_set_global_schema(self)
url = self.lp.private_path(url)
self.url = url
- super(SamDB, self).connect(url=url, flags=flags,
- options=options)
+ super().connect(url=url, flags=flags, options=options)
def am_rodc(self):
"""return True if we are an RODC"""
"""
self.transaction_start()
try:
- seq = super(SamDB, self).sequence_number(seq_type)
+ seq = super().sequence_number(seq_type)
except:
self.transaction_cancel()
raise
def startTest(self, test):
"""Mark a test as starting its test run."""
- super(TestProtocolClient, self).startTest(test)
+ super().startTest(test)
self._stream.write("test: " + test.id() + "\n")
self._stream.flush()
def stopTest(self, test):
"""Mark a test as having finished its test run."""
- super(TestProtocolClient, self).stopTest(test)
+ super().stopTest(test)
self.writeOutcome(test)
def writeOutcome(self, test):
"""A TestResult which calls a hook on every event."""
def __init__(self, decorated):
- self.super = super(HookedTestResultDecorator, self)
+ self.super = super()
self.super.__init__(decorated)
def startTest(self, test):
def __init__(self, decorated):
self._time = None
- super(AutoTimingTestResultDecorator, self).__init__(decorated)
+ super().__init__(decorated)
def _before_event(self):
time = self._time