Merge "Fix DeprecationWarning when printing exception"
This commit is contained in:
commit
728a3419c9
@ -29,8 +29,6 @@ import pkgutil
|
||||
import sys
|
||||
import logging
|
||||
|
||||
import six
|
||||
|
||||
from cinderclient import client
|
||||
from cinderclient import exceptions as exc
|
||||
import cinderclient.extension
|
||||
@ -521,10 +519,7 @@ def main():
|
||||
sys.exit(130)
|
||||
except Exception as e:
|
||||
logger.debug(e, exc_info=1)
|
||||
message = e.message
|
||||
if not isinstance(message, six.string_types):
|
||||
message = str(message)
|
||||
print("ERROR: %s" % strutils.safe_encode(message), file=sys.stderr)
|
||||
print("ERROR: %s" % strutils.six.text_type(e), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user