diff options
| author | kairat_kushaev <kkushaev@mirantis.com> | 2015-09-22 15:40:02 +0300 |
|---|---|---|
| committer | kairat_kushaev <kkushaev@mirantis.com> | 2015-09-22 15:40:02 +0300 |
| commit | c6addc722c99ce2688b335dd20c796c3a5dab1ba (patch) | |
| tree | 88b9ad2e40a09a6f42f6bc28956a64d2b8df027f /glanceclient/common/utils.py | |
| parent | 9f8163ec8207393fc01bdc1717772270197b753a (diff) | |
| download | python-glanceclient-c6addc722c99ce2688b335dd20c796c3a5dab1ba.tar.gz | |
Replace exception_to_str with oslo.utils function
The oslo.utils function has exception_to_unicode that can
replace glance util function exception_to_str.
So we don't to have this exception_to_str function in glance
anymore.
Change-Id: I332bc55558087920fdd6ae2d822bece5166f5ba6
Diffstat (limited to 'glanceclient/common/utils.py')
| -rw-r--r-- | glanceclient/common/utils.py | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py index 55fdd1d..c056063 100644 --- a/glanceclient/common/utils.py +++ b/glanceclient/common/utils.py @@ -319,18 +319,6 @@ def make_size_human_readable(size): return '%s%s' % (stripped, suffix[index]) -def exception_to_str(exc): - try: - error = six.text_type(exc) - except UnicodeError: - try: - error = str(exc) - except UnicodeError: - error = ("Caught '%(exception)s' exception." % - {"exception": exc.__class__.__name__}) - return encodeutils.safe_decode(error, errors='ignore') - - def get_file_size(file_obj): """Analyze file-like object and attempt to determine its size. |
