From: Tommi Virtanen Date: Fri, 13 Jan 2012 19:26:36 +0000 (-0800) Subject: Use yaml.safe_dump so unicode doesn't mess up the yaml files. X-Git-Tag: 1.1.0~2676 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3bfa41cf6ad945c21cf8499f94dd71cf07b3cb04;p=teuthology.git 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 :( --- diff --git a/teuthology/task/s3readwrite.py b/teuthology/task/s3readwrite.py index 14a8977f7..c8dd16187 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 07bb9ed91..c1e2e3046 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),