diff --git a/keystoneauth1/session.py b/keystoneauth1/session.py index eb6d873d..b0469a84 100644 --- a/keystoneauth1/session.py +++ b/keystoneauth1/session.py @@ -273,6 +273,8 @@ class Session(object): if discovery_cache is None: discovery_cache = {} self._discovery_cache = discovery_cache + # NOTE(mordred) split_loggers kwarg default is None rather than False + # so we can distinguish between the value being set or not. self._split_loggers = split_loggers if timeout is not None: @@ -326,9 +328,20 @@ class Session(object): return header def _get_split_loggers(self, split_loggers): + """Get a boolean value from the various argument sources. + + We default split_loggers to None in the kwargs of the Session + constructor so we can track set vs. not set. We also accept + split_loggers as a parameter in a few other places. In each place + we want the parameter, if given by the user, to win. + """ + # None is the default value in each method's kwarg. None means "unset". if split_loggers is None: + # If no value was given, try the value set on the instance. split_loggers = self._split_loggers if split_loggers is None: + # If neither a value was given on the method, nor a value was given + # on the Session constructor, then the value is False. split_loggers = False return split_loggers