os.chmod(paths.binddns_dir, 0o770)
os.chown(paths.binddns_dir, -1, paths.bind_gid)
except OSError:
- if not os.environ.has_key('SAMBA_SELFTEST'):
+ if 'SAMBA_SELFTEST' not in os.environ:
logger.info("Failed to chown %s to bind gid %u",
paths.binddns_dir, paths.bind_gid)
os.chmod(bind_dns_keytab_path, 0o640)
os.chown(bind_dns_keytab_path, -1, paths.bind_gid)
except OSError:
- if not os.environ.has_key('SAMBA_SELFTEST'):
+ if 'SAMBA_SELFTEST' not in os.environ:
logger.info("Failed to chown %s to bind gid %u",
bind_dns_keytab_path, paths.bind_gid)
# chmod needed to cope with umask
os.chmod(dns_dir, 0o770)
except OSError:
- if not os.environ.has_key('SAMBA_SELFTEST'):
+ if 'SAMBA_SELFTEST' not in os.environ:
logger.error("Failed to chown %s to bind gid %u" % (
dns_dir, paths.bind_gid))
# chmod needed to cope with umask
os.chmod(paths.dns, 0o664)
except OSError:
- if not os.environ.has_key('SAMBA_SELFTEST'):
+ if 'SAMBA_SELFTEST' not in os.environ:
logger.error("Failed to chown %s to bind gid %u" % (
paths.dns, paths.bind_gid))
os.chown(fpath, -1, paths.bind_gid)
os.chmod(fpath, 0o660)
except OSError:
- if not os.environ.has_key('SAMBA_SELFTEST'):
+ if 'SAMBA_SELFTEST' not in os.environ:
logger.error(
"Failed to set permissions to sam.ldb* files, fix manually")
else:
- if not os.environ.has_key('SAMBA_SELFTEST'):
+ if 'SAMBA_SELFTEST' not in os.environ:
logger.warning("""Unable to find group id for BIND,
set permissions to sam.ldb* files manually""")
for arc in lines[1:-1]:
match = sre.search('"(.*)" -> "(.*)"', arc)
n1, n2 = match.group(1), match.group(2)
- if not graph.has_key(n1):
+ if n1 not in graph:
graph[n1] = []
graph[n1].append(n2)
subgraph = {}
def add_deps(node):
- if graph.has_key(node) and not subgraph.has_key(node):
+ if node in graph and node not in subgraph:
subgraph[node] = graph[node]
for n in graph[node]:
add_deps(n)