From 1c65c6e03eb09a2f2773407d4dd4bb29123a11f9 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Thu, 2 Nov 2023 19:50:35 +0100 Subject: [PATCH] install: Ignore Cluster$interface deprecation The idea is that until v7.1, zeekctl continues to populate the interface in cluster-layout.zeek just as before, but accesses by users will cause deprecation warnings. --- ZeekControl/install.py | 2 ++ testing/Baseline/command.install-layout-files/logger | 2 ++ testing/Baseline/command.install-layout-files/no-logger | 2 ++ testing/Baseline/command.install-layout-files/two-loggers | 2 ++ testing/Baseline/command.install-zeekport/no-logger | 2 ++ testing/Baseline/command.install-zeekport/two-loggers | 2 ++ testing/Baseline/command.install-zeekport/two-proxies | 2 ++ 7 files changed, 14 insertions(+) diff --git a/ZeekControl/install.py b/ZeekControl/install.py index 7828d11..ade6e92 100644 --- a/ZeekControl/install.py +++ b/ZeekControl/install.py @@ -185,6 +185,7 @@ def use_port(self, node): ostr = "# Automatically generated. Do not edit.\n" ostr += "redef Cluster::manager_is_logger = %s;\n" % manager_is_logger + ostr += "@pragma push ignore-deprecations\n" ostr += "redef Cluster::nodes = {\n" # Control definition. For now just reuse the manager information. @@ -211,6 +212,7 @@ def use_port(self, node): ostr += '\t["time-machine"] = [$node_type=Cluster::TIME_MACHINE, $ip=%s, $p=%s],\n' % (config.Config.timemachinehost, config.Config.timemachineport) ostr += "};\n" + ostr += "@pragma pop ignore-deprecations\n" try: with open(filename, "w") as out: diff --git a/testing/Baseline/command.install-layout-files/logger b/testing/Baseline/command.install-layout-files/logger index 3075a62..2010c13 100644 --- a/testing/Baseline/command.install-layout-files/logger +++ b/testing/Baseline/command.install-layout-files/logger @@ -1,6 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. # Automatically generated. Do not edit. redef Cluster::manager_is_logger = F; +@pragma push ignore-deprecations redef Cluster::nodes = { ["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=27760/tcp], ["logger"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=27761/tcp], @@ -9,3 +10,4 @@ redef Cluster::nodes = { ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27764/tcp, $interface="eth0", $manager="manager"], ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27765/tcp, $interface="eth1", $manager="manager"], }; +@pragma pop ignore-deprecations diff --git a/testing/Baseline/command.install-layout-files/no-logger b/testing/Baseline/command.install-layout-files/no-logger index 5ec27bc..73c0e9a 100644 --- a/testing/Baseline/command.install-layout-files/no-logger +++ b/testing/Baseline/command.install-layout-files/no-logger @@ -1,6 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. # Automatically generated. Do not edit. redef Cluster::manager_is_logger = T; +@pragma push ignore-deprecations redef Cluster::nodes = { ["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=27760/tcp], ["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=27761/tcp], @@ -8,3 +9,4 @@ redef Cluster::nodes = { ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27763/tcp, $interface="eth0", $manager="manager"], ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27764/tcp, $interface="eth1", $manager="manager"], }; +@pragma pop ignore-deprecations diff --git a/testing/Baseline/command.install-layout-files/two-loggers b/testing/Baseline/command.install-layout-files/two-loggers index fb6b31c..5039d21 100644 --- a/testing/Baseline/command.install-layout-files/two-loggers +++ b/testing/Baseline/command.install-layout-files/two-loggers @@ -1,6 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. # Automatically generated. Do not edit. redef Cluster::manager_is_logger = F; +@pragma push ignore-deprecations redef Cluster::nodes = { ["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=27760/tcp], ["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=27761/tcp], @@ -10,3 +11,4 @@ redef Cluster::nodes = { ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27765/tcp, $interface="eth0", $manager="manager"], ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=27766/tcp, $interface="eth1", $manager="manager"], }; +@pragma pop ignore-deprecations diff --git a/testing/Baseline/command.install-zeekport/no-logger b/testing/Baseline/command.install-zeekport/no-logger index 9baa69f..e7a541b 100644 --- a/testing/Baseline/command.install-zeekport/no-logger +++ b/testing/Baseline/command.install-zeekport/no-logger @@ -1,6 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. # Automatically generated. Do not edit. redef Cluster::manager_is_logger = T; +@pragma push ignore-deprecations redef Cluster::nodes = { ["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=41234/tcp], ["manager"] = [$node_type=Cluster::MANAGER, $ip=127.0.0.1, $p=41235/tcp], @@ -8,3 +9,4 @@ redef Cluster::nodes = { ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41237/tcp, $interface="eth0", $manager="manager"], ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41238/tcp, $interface="eth1", $manager="manager"], }; +@pragma pop ignore-deprecations diff --git a/testing/Baseline/command.install-zeekport/two-loggers b/testing/Baseline/command.install-zeekport/two-loggers index 2673a50..aaf429d 100644 --- a/testing/Baseline/command.install-zeekport/two-loggers +++ b/testing/Baseline/command.install-zeekport/two-loggers @@ -1,6 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. # Automatically generated. Do not edit. redef Cluster::manager_is_logger = F; +@pragma push ignore-deprecations redef Cluster::nodes = { ["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=41234/tcp], ["logger-1"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=41235/tcp], @@ -10,3 +11,4 @@ redef Cluster::nodes = { ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41239/tcp, $interface="eth0", $manager="manager"], ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41240/tcp, $interface="eth1", $manager="manager"], }; +@pragma pop ignore-deprecations diff --git a/testing/Baseline/command.install-zeekport/two-proxies b/testing/Baseline/command.install-zeekport/two-proxies index 8a6a7a5..ef8bff7 100644 --- a/testing/Baseline/command.install-zeekport/two-proxies +++ b/testing/Baseline/command.install-zeekport/two-proxies @@ -1,6 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. # Automatically generated. Do not edit. redef Cluster::manager_is_logger = F; +@pragma push ignore-deprecations redef Cluster::nodes = { ["control"] = [$node_type=Cluster::CONTROL, $ip=127.0.0.1, $p=41234/tcp], ["logger"] = [$node_type=Cluster::LOGGER, $ip=127.0.0.1, $p=41235/tcp], @@ -10,3 +11,4 @@ redef Cluster::nodes = { ["worker-1"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41239/tcp, $interface="eth0", $manager="manager"], ["worker-2"] = [$node_type=Cluster::WORKER, $ip=127.0.0.1, $p=41240/tcp, $interface="eth1", $manager="manager"], }; +@pragma pop ignore-deprecations