From: Zack Cerza Date: Tue, 18 Feb 2014 15:54:58 +0000 (-0600) Subject: Change usages of StringIO.read() to getvalue() X-Git-Tag: 1.1.0~1646^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11b60fef81d76d2335f4f618f64682362803c087;p=teuthology.git Change usages of StringIO.read() to getvalue() Signed-off-by: Zack Cerza --- diff --git a/teuthology/task/devstack.py b/teuthology/task/devstack.py index 84600ec7b..e989c7bd6 100644 --- a/teuthology/task/devstack.py +++ b/teuthology/task/devstack.py @@ -175,13 +175,11 @@ def set_libvirt_secret(devstack_node, ceph_node): cinder_key_stringio = StringIO() ceph_node.run(args=['ceph', 'auth', 'get-key', 'client.cinder'], stdout=cinder_key_stringio) - cinder_key_stringio.seek(0) - cinder_key = cinder_key_stringio.read().strip() + cinder_key = cinder_key_stringio.getvalue().strip() uuid_stringio = StringIO() devstack_node.run(args=['uuidgen'], stdout=uuid_stringio) - uuid_stringio.seek(0) - uuid = uuid_stringio.read().strip() + uuid = uuid_stringio.getvalue().strip() secret_path = '/tmp/secret.xml' secret_template = textwrap.dedent(""" @@ -349,14 +347,12 @@ def create_volume(devstack_node, ceph_node, vol_name, size): '--display-name', vol_name, size] out_stream = StringIO() devstack_node.run(args=args, stdout=out_stream, wait=True) - out_stream.seek(0) - vol_info = parse_os_table(out_stream.read()) + vol_info = parse_os_table(out_stream.getvalue()) out_stream = StringIO() ceph_node.run(args="rbd --id cinder ls -l volumes", stdout=out_stream, wait=True) - out_stream.seek(0) - assert vol_info['id'] in out_stream.read() + assert vol_info['id'] in out_stream.getvalue() assert vol_info['size'] == size return vol_info['id']