]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_volume_client: make UTF-8 encoding explicit
authorRishabh Dave <ridave@redhat.com>
Wed, 19 Jun 2019 13:10:57 +0000 (18:40 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 17 Jul 2019 03:47:13 +0000 (09:17 +0530)
Make it explicit in the method to_bytes() that encoding is with UTF-8.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/pybind/ceph_volume_client.py

index 5a242934c02bb90503b03ee560dfcc3862325399..b9e1863fee8c07c06613d5ec67758aad7e7e0e54 100644 (file)
@@ -27,9 +27,9 @@ def to_bytes(param):
     Helper method that returns byte representation of the given parameter.
     '''
     if isinstance(param, str):
-        return param.encode()
+        return param.encode('utf-8')
     else:
-        return str(param).encode()
+        return str(param).encode('utf-8')
 
 class RadosError(Exception):
     """