Fix missing of debug info after we use session
After the introduce of this patch set[1], cli user can't get debug info even --debug is passed. With the patch set[1], the request action will be performed in keystoneclient.session.Session. However the default log level of keystoneclient module is WARNING, so user can't get debug info from keystoneclient.session.Session. This change set the root log level to DEBUG when --debug is passed. [1]: https://review.openstack.org/#/c/262220/ Change-Id: I0db0fd7ab07a0d61082b86829a671d8dbc0f2963 Closes-bug: 1551076
This commit is contained in:
@@ -581,6 +581,12 @@ class OpenStackImagesShell(object):
|
||||
if not args.os_password and options.os_password:
|
||||
args.os_password = options.os_password
|
||||
|
||||
if args.debug:
|
||||
# Set up the root logger to debug so that the submodules can
|
||||
# print debug messages
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
# for iso8601 < 0.1.11
|
||||
logging.getLogger('iso8601').setLevel(logging.WARNING)
|
||||
LOG = logging.getLogger('glanceclient')
|
||||
LOG.addHandler(logging.StreamHandler())
|
||||
LOG.setLevel(logging.DEBUG if args.debug else logging.INFO)
|
||||
|
||||
Reference in New Issue
Block a user