diff options
author | Michael Klishin <klishinm@vmware.com> | 2023-05-02 09:08:26 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 09:08:26 +0400 |
commit | 1e8399be44a653f7c27685c44d08faae85622306 (patch) | |
tree | a5ade22f3d0304829b456beebfd0d828ad4a1d5d | |
parent | 08c49edbd47efdf6a6407676a0f0ae3cddcbc9f3 (diff) | |
parent | d0fadf9e082d5376f64b5f607443f805f10e06c0 (diff) | |
download | rabbitmq-server-git-1e8399be44a653f7c27685c44d08faae85622306.tar.gz |
Merge pull request #8077 from SimonUnge/default_ha_modes_must_be_binary
Coerce default policy ha-mode and ha-sync-mode to binaries
-rw-r--r-- | deps/rabbit/priv/schema/rabbit.schema | 9 | ||||
-rw-r--r-- | deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/deps/rabbit/priv/schema/rabbit.schema b/deps/rabbit/priv/schema/rabbit.schema index 7f5de3b217..814b16a4af 100644 --- a/deps/rabbit/priv/schema/rabbit.schema +++ b/deps/rabbit/priv/schema/rabbit.schema @@ -785,7 +785,14 @@ end}. Conf, ["default_policies", "operator"], fun({["default_policies","operator",ID,"classic_queues"|T], V}) -> - {["default_policies","operator",ID|T],V}; + NewV = case T of + ["ha_sync_mode"] -> + list_to_binary(V); + ["ha_mode"] -> + list_to_binary(V); + _ -> V + end, + {["default_policies","operator",ID|T], NewV}; (E) -> E end), case Props of diff --git a/deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets b/deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets index 05aeb35f70..b9444eed47 100644 --- a/deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets +++ b/deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets @@ -147,9 +147,9 @@ ssl_options.fail_if_no_peer_cert = true", ", [{rabbit, [{default_policies, [{operator, [ {<<"a">>, [{<<"expires">>, 3600000}, - {<<"ha_mode">>, "exactly"}, + {<<"ha_mode">>, <<"exactly">>}, {<<"ha_params">>, 2}, - {<<"ha_sync_mode">>, "automatic"}, + {<<"ha_sync_mode">>, <<"automatic">>}, {<<"queue_pattern">>, "apple"}, {<<"vhost_pattern">>, "banana"}]}]}]}]}], []}, |