From: Kefu Chai Date: Wed, 17 Jun 2020 10:11:57 +0000 (+0800) Subject: teuthology/provision: drop six.ensure_str() X-Git-Tag: 1.1.0~86^2~9 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c9a04e79f8f3a1a6ef6b9ea62a6aa93ffde55e21;p=teuthology.git teuthology/provision: drop six.ensure_str() Signed-off-by: Kefu Chai --- diff --git a/teuthology/provision/cloud/test/test_cloud_util.py b/teuthology/provision/cloud/test/test_cloud_util.py index 8cae3c9dc0..2f6035a7ce 100644 --- a/teuthology/provision/cloud/test/test_cloud_util.py +++ b/teuthology/provision/cloud/test/test_cloud_util.py @@ -21,7 +21,7 @@ def test_get_user_ssh_pubkey(path, exists): with patch('teuthology.provision.cloud.util.open', mock_open(), create=True) as m_open: util.get_user_ssh_pubkey(path) if exists: - m_open.assert_called_once_with(path, 'rb') + m_open.assert_called_once_with(path) @mark.parametrize( diff --git a/teuthology/provision/cloud/util.py b/teuthology/provision/cloud/util.py index c8170a87d4..a6f137e941 100644 --- a/teuthology/provision/cloud/util.py +++ b/teuthology/provision/cloud/util.py @@ -4,16 +4,14 @@ import dateutil.parser import json import os -from six import ensure_str - from teuthology.util.flock import FileLock def get_user_ssh_pubkey(path='~/.ssh/id_rsa.pub'): full_path = os.path.expanduser(path) if not os.path.exists(full_path): return - with open(full_path, 'rb') as f: - return ensure_str(f.read()).strip() + with open(full_path) as f: + return f.read().strip() def combine_dicts(list_of_dicts, func):