From a577f894a908d46e8af422bc4c3b73985b1b5c64 Mon Sep 17 00:00:00 2001 From: Christian Fischer Date: Fri, 10 Jan 2025 09:50:06 +0100 Subject: [PATCH] Change: Fix NASL coding style output of deprecate VT plugin. Adjust test. --- tests/standalone_plugins/test_deprecate_vts.py | 2 +- troubadix/standalone_plugins/deprecate_vts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/standalone_plugins/test_deprecate_vts.py b/tests/standalone_plugins/test_deprecate_vts.py index 7c4450a4..141e6b62 100644 --- a/tests/standalone_plugins/test_deprecate_vts.py +++ b/tests/standalone_plugins/test_deprecate_vts.py @@ -189,7 +189,7 @@ def test_finalize_content(self): result = _finalize_content(NASL_CONTENT) expected = ( '...if(description)\n{\n script_oid("1.3.6.1.4.1.25623.1.0.910673");\n ' - 'script_version("2024-03-12T14:15:13+0000");\n script_name("RedHat: Security Advisory for gd (RHSA-2020:5443-01)");\n script_family("Red Hat Local Security Checks");\n script_dependencies("gather-package-list.nasl");\n script_mandatory_keys("ssh/login/rhel", "ssh/login/rpms", re:"ssh/login/release=RHENT_7");\n\n script_xref(name:"RHSA", value:"2020:5443-01");\n script_xref(name:"URL", value:"https://www.redhat.com/archives/rhsa-announce/2020-December/msg00044.html");\n\n script_tag(name:"summary", value:"The remote host is missing an update for the \'gd\'\n package(s) announced via the RHSA-2020:5443-01 advisory.");\n\n script_tag(name:"deprecated", value:TRUE);\n\nexit(0);\n}\n\nexit(66);\n' # noqa: E501 + 'script_version("2024-03-12T14:15:13+0000");\n script_name("RedHat: Security Advisory for gd (RHSA-2020:5443-01)");\n script_family("Red Hat Local Security Checks");\n script_dependencies("gather-package-list.nasl");\n script_mandatory_keys("ssh/login/rhel", "ssh/login/rpms", re:"ssh/login/release=RHENT_7");\n\n script_xref(name:"RHSA", value:"2020:5443-01");\n script_xref(name:"URL", value:"https://www.redhat.com/archives/rhsa-announce/2020-December/msg00044.html");\n\n script_tag(name:"summary", value:"The remote host is missing an update for the \'gd\'\n package(s) announced via the RHSA-2020:5443-01 advisory.");\n\n script_tag(name:"deprecated", value:TRUE);\n\n exit(0);\n}\n\nexit(66);\n' # noqa: E501 ) self.assertEqual(result, expected) diff --git a/troubadix/standalone_plugins/deprecate_vts.py b/troubadix/standalone_plugins/deprecate_vts.py index 6ec25134..2dba9b28 100644 --- a/troubadix/standalone_plugins/deprecate_vts.py +++ b/troubadix/standalone_plugins/deprecate_vts.py @@ -81,7 +81,7 @@ def _finalize_content(content: str) -> str: content_to_keep = content.split("exit(0);")[0] return content_to_keep + ( 'script_tag(name:"deprecated", value:TRUE);' - "\n\nexit(0);\n}\n\nexit(66);\n" + "\n\n exit(0);\n}\n\nexit(66);\n" )