summaryrefslogtreecommitdiff
path: root/oslo_config/cfg.py
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem.os@gmail.com>2017-09-26 10:46:15 -0400
committerMatt Riedemann <mriedem.os@gmail.com>2017-09-26 10:59:13 -0400
commit0cce0be52abddc670f8d7451f240481eaa9fe208 (patch)
treec67515617f652dd6a402fb8d065e01758d4c335e /oslo_config/cfg.py
parente6749d3208cffd7693353385f92865d9ac737623 (diff)
downloadoslo-config-0cce0be52abddc670f8d7451f240481eaa9fe208.tar.gz
Implement OptGroup.__str__ for log messages4.13.1
This log message has been around since change I6e28c25f04273f7def486fadd541babc8cf423cb. The OptGroup doesn't implement __str__ so the warning message isn't helpful. This change implements __str__ to return the group name so the warning message actually helps people. Change-Id: Ie6d218e7f6ea846b1f7d7f8452cc07f0be9e32a5 Closes-Bug: #1719032
Diffstat (limited to 'oslo_config/cfg.py')
-rw-r--r--oslo_config/cfg.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/oslo_config/cfg.py b/oslo_config/cfg.py
index 0070dbd..cbdcdfa 100644
--- a/oslo_config/cfg.py
+++ b/oslo_config/cfg.py
@@ -1829,6 +1829,9 @@ class OptGroup(object):
"""Clear this group's option parsing state."""
self._argparse_group = None
+ def __str__(self):
+ return self.name
+
class ParseError(iniparser.ParseError):
def __init__(self, msg, lineno, line, filename):