diff --git a/oslo_config/cfg.py b/oslo_config/cfg.py index 0070dbd8..cbdcdfae 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): diff --git a/oslo_config/tests/test_cfg.py b/oslo_config/tests/test_cfg.py index 9c3767b3..67d9c434 100644 --- a/oslo_config/tests/test_cfg.py +++ b/oslo_config/tests/test_cfg.py @@ -2235,6 +2235,7 @@ class OptGroupsTestCase(BaseTestCase): self.assertTrue(hasattr(self.conf, 'blaa')) self.assertTrue(hasattr(self.conf.blaa, 'foo')) self.assertEqual('bar', self.conf.blaa.foo) + self.assertEqual('blaa', str(blaa_group)) def test_autocreate_group_by_name(self): self.conf.register_cli_opt(cfg.StrOpt('foo'), group='blaa')