summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorJoe Guo <joeg@catalyst.net.nz>2018-08-20 16:18:45 +1200
committerDouglas Bagnall <dbagnall@samba.org>2018-10-10 06:16:21 +0200
commit57594c8772aac6341516fb78f452564f83cec54a (patch)
tree5b73ecc0ae89de3c12e0e9a2f95af2e19ec791ae /script
parent33ce1fa23e8dfc0e392aa09733f36c5f2418a6fe (diff)
downloadsamba-57594c8772aac6341516fb78f452564f83cec54a.tar.gz
script/traffic_replay: get debug level via api
The -d option will set samba global debug level automatically. We should not parse and use the passed in value. Use samba.get_debug_level instead. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'script')
-rwxr-xr-xscript/traffic_replay9
1 files changed, 5 insertions, 4 deletions
diff --git a/script/traffic_replay b/script/traffic_replay
index a5074448ded..a1a293b0ea0 100755
--- a/script/traffic_replay
+++ b/script/traffic_replay
@@ -26,7 +26,7 @@ import random
sys.path.insert(0, "bin/python")
-from samba import gensec
+from samba import gensec, get_debug_level
from samba.emulate import traffic
import samba.getopt as options
@@ -134,6 +134,9 @@ def main():
parser.print_usage()
return
+ debuglevel = get_debug_level()
+ traffic.DEBUG_LEVEL = debuglevel
+
if opts.clean_up:
print_err("Removing user and machine accounts")
lp = sambaopts.get_loadparm()
@@ -223,8 +226,6 @@ def main():
print_err(e)
sys.exit()
- traffic.DEBUG_LEVEL = opts.debuglevel
-
duration = opts.duration
if duration is None:
duration = 60.0
@@ -269,7 +270,7 @@ def main():
else:
conversations = []
- if opts.debuglevel > 5:
+ if debuglevel > 5:
for c in conversations:
for p in c.packets:
print(" ", p, file=sys.stderr)