From 59daf4bf02b60a523d7f68004b75316086e91d2a Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Wed, 16 Apr 2014 17:07:03 -0500 Subject: [PATCH] CLI always configures logging When the keystone CLI wound up logging something and --debug wasn't set, a message was printed that 'No handlers could be found for logger '. This is because Python logging was only configured when the --debug option was set. This change makes it so that logging is always configured. If --debug is used then the level is DEBUG and if it's not used then the level is WARNING. Change-Id: Ib01d1072acff0d6ede468b0ecab4f871459014ee Closes-Bug: #936404 --- keystoneclient/shell.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py index a4d8a1fb7..3aebaddb0 100644 --- a/keystoneclient/shell.py +++ b/keystoneclient/shell.py @@ -383,7 +383,11 @@ class OpenStackIdentityShell(object): return 0 if args.debug: - logging.basicConfig(level=logging.DEBUG) + logging_level = logging.DEBUG + else: + logging_level = logging.WARNING + + logging.basicConfig(level=logging_level) # TODO(heckj): supporting backwards compatibility with environment # variables. To be removed after DEVSTACK is updated, ideally in