]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Change usages of StringIO.read() to getvalue()
authorZack Cerza <zack@cerza.org>
Tue, 18 Feb 2014 15:54:58 +0000 (09:54 -0600)
committerZack Cerza <zack@cerza.org>
Thu, 20 Feb 2014 23:46:09 +0000 (17:46 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/task/devstack.py

index 84600ec7b9f73be2c9266d07e8d3472550ea10bd..e989c7bd68d73d3a663d9a998f90384e4901199e 100644 (file)
@@ -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']