From: Kyr Shatskyy Date: Mon, 16 Dec 2019 02:47:38 +0000 (+0100) Subject: qa/tasks/devstack: get rid of cStringIO X-Git-Tag: v15.2.4~42^2~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5d77c00c6bf49109655921f4be1a2385d5970e19;p=ceph.git qa/tasks/devstack: get rid of cStringIO Signed-off-by: Kyr Shatskyy (cherry picked from commit b23ae40a8b07dbbfee23c746b583d3c94bcfd4e5) --- diff --git a/qa/tasks/devstack.py b/qa/tasks/devstack.py index 446a3af4b90..9243071a4bf 100644 --- a/qa/tasks/devstack.py +++ b/qa/tasks/devstack.py @@ -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("""