]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/provision: drop six.ensure_str()
authorKefu Chai <kchai@redhat.com>
Wed, 17 Jun 2020 10:11:57 +0000 (18:11 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 17 Jun 2020 14:19:20 +0000 (22:19 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/provision/cloud/test/test_cloud_util.py
teuthology/provision/cloud/util.py

index 8cae3c9dc06cf9a9ba128c4faf3e9438152e5281..2f6035a7ce67b8a343249a9f638453e9ea2e9a12 100644 (file)
@@ -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(
index c8170a87d4e98427f1ddbef63dc4f2c07c61c909..a6f137e941a42bdee092db2e35783cd3993c274e 100644 (file)
@@ -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):