Property name 'user_config_flags' used more than once

Bug #1986943 reported by Corey Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Masakari Monitors Charm
Fix Committed
Undecided
Unassigned

Bug Description

There are 2 bugs in the masakari-monitors user flags support:

1) They aren't put in the [DEFAULT] section (they're put in the [api] section)

2) Unit tests have started failing as shown below. This is new since charms.openstack gained support for config flags:
https://github.com/openstack/charms.openstack/commit/d049eee8f47e3913123762b6cd4f493e8ff0d18d
https://github.com/openstack/charms.openstack/commit/18ac668cd78e16adba5706e4d9606ff3f15ddd6e

==============================
Failed 2 tests - output below:
==============================

unittest.loader._FailedTest.unit_tests.test_lib_charm_openstack_masakari_monitors
---------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    ImportError: Failed to import test module: unit_tests.test_lib_charm_openstack_masakari_monitors
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/mnt/release-tools/charms/masakari-monitors/unit_tests/test_lib_charm_openstack_masakari_monitors.py", line 19, in <module>
    import charm.openstack.masakari_monitors as masakari_monitors
  File "/mnt/release-tools/charms/masakari-monitors/src/lib/charm/openstack/masakari_monitors.py", line 16, in <module>
    class MasakariMonitorsCharm(charms_openstack.charm.OpenStackCharm):
  File "/mnt/release-tools/charms/masakari-monitors/src/lib/charm/openstack/masakari_monitors.py", line 65, in MasakariMonitorsCharm
    def user_config_flags(self):
  File "/mnt/release-tools/charms/masakari-monitors/.tox/py38/lib/python3.8/site-packages/charms_openstack/adapters.py", line 81, in config_property
    raise RuntimeError(
RuntimeError: Property name 'user_config_flags' used more than once for configuration?

unittest.loader._FailedTest.unit_tests.test_masakari_monitors_handlers
----------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    ImportError: Failed to import test module: unit_tests.test_masakari_monitors_handlers
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/mnt/release-tools/charms/masakari-monitors/unit_tests/test_masakari_monitors_handlers.py", line 17, in <module>
    import reactive.masakari_monitors_handlers as handlers
  File "/mnt/release-tools/charms/masakari-monitors/src/reactive/masakari_monitors_handlers.py", line 19, in <module>
    import charm.openstack.masakari_monitors as masakari_monitors # noqa
  File "/mnt/release-tools/charms/masakari-monitors/src/lib/charm/openstack/masakari_monitors.py", line 8, in <module>
    charms_openstack.charm.use_defaults('charm.default-select-release')
  File "/mnt/release-tools/charms/masakari-monitors/.tox/py38/lib/python3.8/site-packages/charms_openstack/charm/defaults.py", line 44, in use_defaults
    _default_handler_map[state]()
  File "/mnt/release-tools/charms/masakari-monitors/.tox/py38/lib/python3.8/site-packages/charms_openstack/charm/defaults.py", line 92, in make_default_select_release_handler
    def default_select_release():
  File "/mnt/release-tools/charms/masakari-monitors/.tox/py38/lib/python3.8/site-packages/charms_openstack/charm/core.py", line 190, in register_os_release_selector
    raise RuntimeError(
RuntimeError: Only a single release_selector_function is supported. Called with default_select_release

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-masakari-monitors (master)
Changed in charm-masakari-monitors:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-masakari-monitors (master)

Reviewed: https://review.opendev.org/c/openstack/charm-masakari-monitors/+/853657
Committed: https://opendev.org/openstack/charm-masakari-monitors/commit/e7fd6815c902604970b8069409cfcc0113dc33f3
Submitter: "Zuul (22348)"
Branch: master

commit e7fd6815c902604970b8069409cfcc0113dc33f3
Author: Corey Bryant <email address hidden>
Date: Wed Oct 12 13:10:11 2022 +0000

    Fix config-flags support

    This change puts the specified key/value config-flags into
    the [DEFAULT] section of the config file rather than the [api]
    section, as they were supposed to be in the [DEFAULT] section.

    Additionally, this change switches to using the config-flags
    support from charms.openstack.

    Closes-Bug: #1986943
    Change-Id: I77a35c074e234c3bdfa78800b05ee770492e0694

Changed in charm-masakari-monitors:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-masakari-monitors (stable/zed)
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.