]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/devstack: get rid of cStringIO
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 16 Dec 2019 02:47:38 +0000 (03:47 +0100)
committerKefu Chai <kchai@redhat.com>
Sun, 14 Jun 2020 08:34:53 +0000 (16:34 +0800)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
(cherry picked from commit b23ae40a8b07dbbfee23c746b583d3c94bcfd4e5)

qa/tasks/devstack.py

index 446a3af4b903023a3e4c4219c1b7ec172592a7f8..9243071a4bf01136dda4ed844394e755334b35e7 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 import contextlib
 import logging
-from cStringIO import StringIO
+from io import BytesIO
 import textwrap
 from configparser import ConfigParser
 
@@ -142,7 +142,7 @@ def distribute_ceph_keys(devstack_node, ceph_node):
     log.info("Copying Ceph keys to DevStack node...")
 
     def copy_key(from_remote, key_name, to_remote, dest_path, owner):
-        key_stringio = StringIO()
+        key_stringio = BytesIO()
         from_remote.run(
             args=['sudo', 'ceph', 'auth', 'get-or-create', key_name],
             stdout=key_stringio)
@@ -174,14 +174,8 @@ def distribute_ceph_keys(devstack_node, ceph_node):
 def set_libvirt_secret(devstack_node, ceph_node):
     log.info("Setting libvirt secret...")
 
-    cinder_key_stringio = StringIO()
-    ceph_node.run(args=['sudo', 'ceph', 'auth', 'get-key', 'client.cinder'],
-                  stdout=cinder_key_stringio)
-    cinder_key = cinder_key_stringio.getvalue().strip()
-
-    uuid_stringio = StringIO()
-    devstack_node.run(args=['uuidgen'], stdout=uuid_stringio)
-    uuid = uuid_stringio.getvalue().strip()
+    cinder_key = ceph_node.sh('sudo ceph auth get-key client.cinder').strip()
+    uuid = devstack_node.sh('uuidgen').strip()
 
     secret_path = '/tmp/secret.xml'
     secret_template = textwrap.dedent("""