1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

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>
This commit is contained in:
Douglas Bagnall 2018-10-23 11:00:20 +13:00 committed by Douglas Bagnall
parent 9e0effc175
commit bda7f35a5e

View File

@ -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 = []