From dd40184db64542709a92cbeefa7501ce5064e83e Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Tue, 19 Nov 2024 16:32:44 -0500 Subject: [PATCH] feat configurator.Cluster: add remove_domain Signed-off-by: Jean-Louis Leroy --- src/python/blazingmq/dev/configurator/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/python/blazingmq/dev/configurator/__init__.py b/src/python/blazingmq/dev/configurator/__init__.py index a5508ccab3..a82eb47833 100644 --- a/src/python/blazingmq/dev/configurator/__init__.py +++ b/src/python/blazingmq/dev/configurator/__init__.py @@ -227,6 +227,19 @@ def _add_domain(self, domain: "Domain") -> "Domain": return domain + def remove_domain(self, name: str) -> None: + """ + Remove a domain from the Cluster's map and all the domain's maps. + + The domain must exist in `Cluster.domains`. It can be missing from the + broker's domain maps. + """ + + del self.domains[name] + + for node in self.nodes.values(): + node.domains.pop(name, None) + class Cluster(AbstractCluster): def domain(self, parameters: mqbconf.Domain) -> "Domain":