No default logger

Bug #1599303 reported by Michael Gale
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystoneauth
Won't Fix
Undecided
Unassigned

Bug Description

Using:
keystoneauth1==2.9.0
ansible=2.1.0.0

I am attempting to build instances in OpenStack Liberty using the ansible os_server module. If I am building instances linearly everything works as expected.

If I try and use ansibles async option it explodes with JSON parsing errors, those appeared to be caused by the following output:
"No handlers could be found for logger keystoneauth.identity.generic.base".

Adding the following to keystoneauth.__init__.py resolves the issue but is most likely not the correct fix:
--snip--
import logging
logging.raiseExceptions = False
--snip--

The bug is mostly related to this call:
file: kesytoneauth.identity.generic.base and the assumptions that _utils makes around getlogger.
--snip--
 17
 18 from keystoneauth1 import _utils as utils
 19 from keystoneauth1 import discover
 20 from keystoneauth1 import exceptions
 21 from keystoneauth1.identity import base
 22
 23
 24 LOG = utils.get_logger(__name__)
 25
--snip--

Revision history for this message
Jamie Lennox (jamielennox) wrote :

I'm not sure this is something that keystoneauth has much control over. Using the logging library (which is what utils.get_logger is doing) is a common practice in python that lets the base application set up some sort of sensible logging (like to a file, or syslog or whatever) and have all its libraries do the right thing.

The easiest way to silence this is in your application do like:

import logging

logging.basicConfig(level=logging.WARN)

which will emit to the console only things of WARN level. You can then do more complex logging as it makes sense.

Revision history for this message
Michael Gale (gale-michael) wrote :

Should I be logging this bug with the ansible team in regards to the os_* modules? Specifically the os_server module?

Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

Michael,

I think this is on the consumer to set logging up (so something that goes into the Ansible modules) in this case. I'm going to mark this as something we wont fix here. Keystoneauth doesn't want to make assumptions about your logging in these cases because it might get it wrong.

Changed in keystoneauth:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.