Fix placement_client group help docs generation
To get the placement_client OptGroup help text to generate in the docs, we have to use the OptGroup object in the list_opts() method rather than a string for the group name. https://docs.openstack.org/oslo.config/latest/cli/generator.html#defining-option-discovery-entry-points Change-Id: Ie728081caa205ded2435c6b95f5e8d4bbd23372c
This commit is contained in:
@@ -38,4 +38,4 @@ def register_opts(conf):
|
|||||||
|
|
||||||
|
|
||||||
def list_opts():
|
def list_opts():
|
||||||
return [(placement_group.name, placement_opts)]
|
return [(placement_group, placement_opts)]
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
from oslo_config import cfg
|
||||||
from stevedore import extension
|
from stevedore import extension
|
||||||
|
|
||||||
from watcher.conf import opts
|
from watcher.conf import opts
|
||||||
@@ -74,7 +75,10 @@ class TestListOpts(base.TestCase):
|
|||||||
result = opts.list_opts()
|
result = opts.list_opts()
|
||||||
|
|
||||||
self.assertIsNotNone(result)
|
self.assertIsNotNone(result)
|
||||||
for section_name, options in result:
|
for name_or_group, options in result:
|
||||||
|
section_name = name_or_group
|
||||||
|
if isinstance(name_or_group, cfg.OptGroup):
|
||||||
|
section_name = name_or_group.name
|
||||||
self.assertIn(section_name, expected_sections)
|
self.assertIn(section_name, expected_sections)
|
||||||
self.assertTrue(len(options))
|
self.assertTrue(len(options))
|
||||||
|
|
||||||
@@ -106,7 +110,10 @@ class TestListOpts(base.TestCase):
|
|||||||
result = opts.list_opts()
|
result = opts.list_opts()
|
||||||
|
|
||||||
self.assertIsNotNone(result)
|
self.assertIsNotNone(result)
|
||||||
for section_name, options in result:
|
for name_or_group, options in result:
|
||||||
|
section_name = name_or_group
|
||||||
|
if isinstance(name_or_group, cfg.OptGroup):
|
||||||
|
section_name = name_or_group.name
|
||||||
self.assertIn(section_name, expected_sections)
|
self.assertIn(section_name, expected_sections)
|
||||||
self.assertTrue(len(options))
|
self.assertTrue(len(options))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user