X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Futil%2F__init__.py;fp=src%2Fceph%2Fsrc%2Fceph-volume%2Fceph_volume%2Futil%2F__init__.py;h=3b8c30906129db18092d951dbcdd8f16f92cb0f1;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/ceph-volume/ceph_volume/util/__init__.py b/src/ceph/src/ceph-volume/ceph_volume/util/__init__.py new file mode 100644 index 0000000..3b8c309 --- /dev/null +++ b/src/ceph/src/ceph-volume/ceph_volume/util/__init__.py @@ -0,0 +1,10 @@ + +def as_string(string): + """ + Ensure that whatever type of string is incoming, it is returned as an + actual string, versus 'bytes' which Python 3 likes to use. + """ + if isinstance(string, bytes): + # we really ignore here if we can't properly decode with utf-8 + return string.decode('utf-8', 'ignore') + return string