mirror of
https://github.com/samba-team/samba.git
synced 2025-01-05 09:18:06 +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:
parent
9e0effc175
commit
bda7f35a5e
@ -243,23 +243,9 @@ def main():
|
|||||||
|
|
||||||
# ingest the model
|
# ingest the model
|
||||||
if model_file and not opts.generate_users_only:
|
if model_file and not opts.generate_users_only:
|
||||||
|
model = traffic.TrafficModel()
|
||||||
try:
|
try:
|
||||||
model = traffic.TrafficModel()
|
model.load(model_file)
|
||||||
|
|
||||||
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)
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
if debuglevel > 0:
|
if debuglevel > 0:
|
||||||
import traceback
|
import traceback
|
||||||
@ -269,6 +255,14 @@ def main():
|
|||||||
% model_file))
|
% model_file))
|
||||||
sys.exit(1)
|
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:
|
else:
|
||||||
conversations = []
|
conversations = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user