"DNSFOREST",
]
+def adjust_cmd_for_py_version(parts):
+ if os.getenv("PYTHON", None):
+ parts.insert(0, os.environ["PYTHON"])
+ return parts
def set_auto_replication(dc, allow):
credstring = '-U%s%%%s' % (os.environ["USERNAME"], os.environ["PASSWORD"])
for opt in ['DISABLE_INBOUND_REPL',
'DISABLE_OUTBOUND_REPL']:
- cmd = ['bin/samba-tool',
+ cmd = adjust_cmd_for_py_version(['bin/samba-tool',
'drs', 'options',
credstring, dc,
- "--dsa-option=%s%s" % (on_or_off, opt)]
+ "--dsa-option=%s%s" % (on_or_off, opt)])
subprocess.check_call(cmd)
def force_replication(src, dest, base):
credstring = '-U%s%%%s' % (os.environ["USERNAME"], os.environ["PASSWORD"])
- cmd = ['bin/samba-tool',
+ cmd = adjust_cmd_for_py_version(['bin/samba-tool',
'drs', 'replicate',
dest, src, base,
credstring,
- '--sync-forced']
+ '--sync-forced'])
subprocess.check_call(cmd)
maximum = values[-1]
length = len(values)
if length % 2 == 0:
- index = length/2 - 1
+ index = length//2 - 1
median = (values[index] + values[index+1])/2.0
median = round(median, 1) # keep only 1 decimal digit like 2.5
else:
- index = (length - 1)/2
+ index = (length - 1)//2
median = values[index]
median = float(median) # ensure median is always a float like 1.0
# if value not exist, that's a failure