diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2018-10-23 11:00:20 +1300 |
---|---|---|
committer | Douglas Bagnall <dbagnall@samba.org> | 2019-01-08 23:55:34 +0100 |
commit | bda7f35a5e1418a3e9d4f582f72d2bbe9cb10f44 (patch) | |
tree | 742e2ed08e22d8d876cf4e054aa96e3856d1b1c3 /script/traffic_replay | |
parent | 9e0effc1757cd1c5f839a90eb04c4a481d518207 (diff) | |
download | samba-bda7f35a5e1418a3e9d4f582f72d2bbe9cb10f44.tar.gz |
traffic_model: don't report generation errors as parse errors
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'script/traffic_replay')
-rwxr-xr-x | script/traffic_replay | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/script/traffic_replay b/script/traffic_replay index 6131ffad2e8..b25476cae4a 100755 --- a/script/traffic_replay +++ b/script/traffic_replay @@ -243,23 +243,9 @@ def main(): # ingest the model if model_file and not opts.generate_users_only: + model = traffic.TrafficModel() try: - model = traffic.TrafficModel() - - try: - model.load(model_file) - except ValueError: - logger.error(("Could not parse %s. The model file " - "should be generated by the " - "traffic_learner script.") % model_file) - sys.exit() - - logger.info(("Using the specified model file to " - "generate conversations")) - - conversations = model.generate_conversation_sequences(opts.scale_traffic, - opts.duration, - opts.replay_rate) + model.load(model_file) except ValueError: if debuglevel > 0: import traceback @@ -269,6 +255,14 @@ def main(): % model_file)) sys.exit(1) + logger.info(("Using the specified model file to " + "generate conversations")) + + conversations = \ + model.generate_conversation_sequences( + opts.scale_traffic, + opts.duration, + opts.replay_rate) else: conversations = [] |