From 388ba75fb6b42e385151b29f24a1f0f180bd8260 Mon Sep 17 00:00:00 2001 From: Sergey Reshetnyak Date: Sun, 11 Jan 2015 15:15:52 +0300 Subject: [PATCH] Fix for sahara CLI Sahara CLI did not work because 'safe_encode' and 'safe_decode' methods have been moved from 'oslo.utils.strutils' module to 'oslo.utils.encodeutils' module Change-Id: Ica8cf4e8ec058fa0764e69945609f2a19effb840 Closes-bug: #1409432 --- saharaclient/shell.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/saharaclient/shell.py b/saharaclient/shell.py index 8e2bb7a0..141bf378 100644 --- a/saharaclient/shell.py +++ b/saharaclient/shell.py @@ -51,7 +51,8 @@ from keystoneclient.auth.identity.generic import password from keystoneclient.auth.identity.generic import token from keystoneclient.auth.identity import v3 as identity from keystoneclient import session -from oslo.utils import strutils +from oslo_utils import encodeutils +from oslo_utils import strutils from saharaclient.api import client from saharaclient.api import shell as shell_api @@ -702,11 +703,12 @@ class OpenStackHelpFormatter(argparse.HelpFormatter): def main(): try: - OpenStackSaharaShell().main(map(strutils.safe_decode, sys.argv[1:])) + OpenStackSaharaShell().main(map(encodeutils.safe_decode, + sys.argv[1:])) except Exception as e: logger.debug(e, exc_info=1) - print("ERROR: %s" % strutils.safe_encode(six.text_type(e)), + print("ERROR: %s" % encodeutils.safe_encode(six.text_type(e)), file=sys.stderr) sys.exit(1)