]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: refresh public_network for config checks before checking 56325/head
authorAdam King <adking@redhat.com>
Wed, 13 Mar 2024 19:30:25 +0000 (15:30 -0400)
committerAdam King <adking@redhat.com>
Tue, 19 Mar 2024 20:46:03 +0000 (16:46 -0400)
commitf2b400ca2117f418fc5c82ade99c589e6fa93b4e
treec856d6aa0ecb7afc87b1ca87ff539dc2fc16725f
parent78dbc53aa74481debe12189646c683a43626f88b
mgr/cephadm: refresh public_network for config checks before checking

The place it was being run before meant it would only grab the
public_network setting once at startup of the module. This meant
if a user changed the setting, which they are likely to do if they
get the warning, cephadm would ignore the change and continue
reporting that the hosts don't match up with the old setting
for the public_network. This moves the call to refresh the
setting to right before we actually run the checks. It does
mean we'll do the `ceph config dump --format json` call
each serve loop iteration, but I've found that only tends
to take a few milliseconds, which is nothing compared to
the time to refresh other things we check during the serve
loop.

I additionally modified the use of this option to use
the attribute on the mgr, rather than calling
`get_module_option`. This was just to get it more in
line with how we tend to handle other config options

Fixes: https://tracker.ceph.com/issues/64902
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 129c10b4da518b8843ac0bc5397276eb695d4033)
src/pybind/mgr/cephadm/configchecks.py
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/tests/test_configchecks.py