From 72b3b23c04fc70bc6e45387b11ada62acc630cf9 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Fri, 6 Dec 2024 10:54:23 -0700 Subject: [PATCH] Remove old obsolete BroControl directory --- BroControl/__init__.py | 8 ---- BroControl/cmdresult.py | 7 ---- BroControl/config.py | 7 ---- BroControl/plugin.py | 7 ---- CMakeLists.txt | 2 - .../initialization.zeekctl-legacy-option/out | 3 -- testing/Cfg/plugins/commandtest_legacy.py | 39 ------------------- .../Cfg/plugins/zeekctlconfigtest_legacy.py | 21 ---------- .../initialization/zeekctl-legacy-option.test | 13 ------- 9 files changed, 107 deletions(-) delete mode 100644 BroControl/__init__.py delete mode 100644 BroControl/cmdresult.py delete mode 100644 BroControl/config.py delete mode 100644 BroControl/plugin.py delete mode 100644 testing/Baseline/initialization.zeekctl-legacy-option/out delete mode 100644 testing/Cfg/plugins/commandtest_legacy.py delete mode 100644 testing/Cfg/plugins/zeekctlconfigtest_legacy.py delete mode 100644 testing/initialization/zeekctl-legacy-option.test diff --git a/BroControl/__init__.py b/BroControl/__init__.py deleted file mode 100644 index 72063999..00000000 --- a/BroControl/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -import sys - -msg = """ -Error: ZeekControl plugin uses legacy BroControl API. Use -'import ZeekControl.plugin' instead of 'import BroControl.plugin'. -""" -print(msg, file=sys.stderr) -sys.exit(1) diff --git a/BroControl/cmdresult.py b/BroControl/cmdresult.py deleted file mode 100644 index d366779e..00000000 --- a/BroControl/cmdresult.py +++ /dev/null @@ -1,7 +0,0 @@ -# -# Legacy BroControl Plugin API. Importing it will abort. -# - -import ZeekControl.cmdresult - -CmdResult = ZeekControl.cmdresult.CmdResult diff --git a/BroControl/config.py b/BroControl/config.py deleted file mode 100644 index 2592b58b..00000000 --- a/BroControl/config.py +++ /dev/null @@ -1,7 +0,0 @@ -# -# Legacy BroControl Plugin API. Importing it will abort. -# - -import ZeekControl.config - -Config = ZeekControl.config.Config diff --git a/BroControl/plugin.py b/BroControl/plugin.py deleted file mode 100644 index 456a730a..00000000 --- a/BroControl/plugin.py +++ /dev/null @@ -1,7 +0,0 @@ -# -# Legacy BroControl Plugin API. Importing it will abort. -# - -import ZeekControl.plugin - -Plugin = ZeekControl.plugin.Plugin diff --git a/CMakeLists.txt b/CMakeLists.txt index a6a1fb62..ac006b5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -269,8 +269,6 @@ if ( NOT BINARY_PACKAGING_MODE ) ") endif () -install(DIRECTORY BroControl DESTINATION ${PY_MOD_INSTALL_DIR}/zeekctl) - ######################################################################## ## Packaging Setup diff --git a/testing/Baseline/initialization.zeekctl-legacy-option/out b/testing/Baseline/initialization.zeekctl-legacy-option/out deleted file mode 100644 index 25bd3217..00000000 --- a/testing/Baseline/initialization.zeekctl-legacy-option/out +++ /dev/null @@ -1,3 +0,0 @@ -### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -Error: option 'BroPort' is no longer supported, please use 'ZeekPort' instead -Error: option 'BroArgs' is no longer supported, please use 'ZeekArgs' instead diff --git a/testing/Cfg/plugins/commandtest_legacy.py b/testing/Cfg/plugins/commandtest_legacy.py deleted file mode 100644 index 89359241..00000000 --- a/testing/Cfg/plugins/commandtest_legacy.py +++ /dev/null @@ -1,39 +0,0 @@ -# Zeekctl test plugin that defines custom commands using the old BroControl -# legacy API. - -import BroControl.cmdresult -import BroControl.plugin - - -class CommandTest(BroControl.plugin.Plugin): - def __init__(self): - super().__init__(apiversion=1) - - def name(self): - return "commandtest" - - def pluginVersion(self): - return 1 - - def init(self): - return True - - def commands(self): - return [ - ("testcmd", "[]", "Test command that expects arguments"), - ("", "", "Another test command"), - ] - - def cmd_custom(self, cmd, args, cmdout): - results = BroControl.cmdresult.CmdResult() - - # This is an easy way to force the plugin command to return failure. - if args == "fail": - results.ok = False - else: - results.ok = True - - cmdout.info(f"Command name: {cmd}") - cmdout.info(f"Command args: {args}") - - return results diff --git a/testing/Cfg/plugins/zeekctlconfigtest_legacy.py b/testing/Cfg/plugins/zeekctlconfigtest_legacy.py deleted file mode 100644 index d6265464..00000000 --- a/testing/Cfg/plugins/zeekctlconfigtest_legacy.py +++ /dev/null @@ -1,21 +0,0 @@ -# Zeekctl test plugin that defines a string to write to zeekctl-config.zeek -# using the old legacy BroControl API. - -import BroControl.plugin - - -class BroctlConfigTest(BroControl.plugin.Plugin): - def __init__(self): - super().__init__(apiversion=1) - - def name(self): - return "broctlconfigtest" - - def pluginVersion(self): - return 1 - - def init(self): - return True - - def broctl_config(self): - return 'redef TestVar = "this is a test";\nredef Test="another test";' diff --git a/testing/initialization/zeekctl-legacy-option.test b/testing/initialization/zeekctl-legacy-option.test deleted file mode 100644 index 96337528..00000000 --- a/testing/initialization/zeekctl-legacy-option.test +++ /dev/null @@ -1,13 +0,0 @@ -# Test that old legacy BroControl options abort. -# -# @TEST-EXEC-FAIL: bash %INPUT -# @TEST-EXEC: btest-diff out - -. zeekctl-test-setup - -cat > $ZEEKCTL_INSTALL_PREFIX/etc/zeekctl.cfg << EOF -BroArgs=FooBar -BroPort=5000 -EOF - -zeekctl config >out 2>&1