From f6b91d5b21b660217e792bf75b6fcb435232c383 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 19 Oct 2018 16:03:25 +1300 Subject: [PATCH] traffic: use default value for --duration We could not do this when we replayed traffic summaries (as opposed to models), but now this script does not do that. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- script/traffic_replay | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/script/traffic_replay b/script/traffic_replay index d3f1c14d4f4..e267935b9dd 100755 --- a/script/traffic_replay +++ b/script/traffic_replay @@ -79,7 +79,7 @@ def main(): model_group.add_option('-S', '--scale-traffic', type='float', default=1.0, help='Increase the number of conversations by ' 'this factor') - model_group.add_option('-D', '--duration', type='float', default=None, + model_group.add_option('-D', '--duration', type='float', default=60.0, help=('Run model for this long (approx). ' 'Default 60s for models')) model_group.add_option('-r', '--replay-rate', type='float', default=1.0, @@ -234,10 +234,6 @@ def main(): "(%s) is not writable" % opts.traffic_summary)) sys.exit() - duration = opts.duration - if duration is None: - duration = 60.0 - # ingest the model if model_file: try: @@ -255,7 +251,7 @@ def main(): "generate conversations")) conversations = model.generate_conversations(opts.scale_traffic, - duration, + opts.duration, opts.replay_rate) except ValueError: logger.error(("Could not parse %s, which does not seem to be " @@ -368,7 +364,7 @@ def main(): creds=creds, accounts=accounts, dns_rate=opts.dns_rate, - duration=duration, + duration=opts.duration, badpassword_frequency=opts.badpassword_frequency, prefer_kerberos=opts.prefer_kerberos, statsdir=statsdir,