From 3bfa41cf6ad945c21cf8499f94dd71cf07b3cb04 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Fri, 13 Jan 2012 11:26:36 -0800 Subject: [PATCH] Use yaml.safe_dump so unicode doesn't mess up the yaml files. In general, yaml.dump is comparable to pickle, and my personal coding standard says *never* use it. yaml.safe_dump is much nicer. yaml.dump should have been named yaml.unsafe_dump, yaml.safe_dump should have been named yaml.dump :( --- teuthology/task/s3readwrite.py | 2 +- teuthology/task/s3roundtrip.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/teuthology/task/s3readwrite.py b/teuthology/task/s3readwrite.py index 14a8977f73..c8dd16187f 100644 --- a/teuthology/task/s3readwrite.py +++ b/teuthology/task/s3readwrite.py @@ -118,7 +118,7 @@ def configure(ctx, config): s3=s3tests_conf['s3'], readwrite=s3tests_conf['readwrite'], ) - yaml.dump(conf, conf_fp, default_flow_style=False) + yaml.safe_dump(conf, conf_fp, default_flow_style=False) teuthology.write_file( remote=remote, path='/tmp/cephtest/archive/s3readwrite.{client}.config.yaml'.format(client=client), diff --git a/teuthology/task/s3roundtrip.py b/teuthology/task/s3roundtrip.py index 07bb9ed91f..c1e2e3046e 100644 --- a/teuthology/task/s3roundtrip.py +++ b/teuthology/task/s3roundtrip.py @@ -118,7 +118,7 @@ def configure(ctx, config): s3=s3tests_conf['s3'], roundtrip=s3tests_conf['roundtrip'], ) - yaml.dump(conf, conf_fp, default_flow_style=False) + yaml.safe_dump(conf, conf_fp, default_flow_style=False) teuthology.write_file( remote=remote, path='/tmp/cephtest/archive/s3roundtrip.{client}.config.yaml'.format(client=client), -- 2.39.5