From dfcbd95d0bb55c81aa099ff68ad08636121f1e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= Date: Thu, 31 Oct 2024 16:41:38 +0100 Subject: [PATCH] Simplify template The flags "S" and "R" are set in FLAGS variable always. Since they're set always, we don't have to set them at all. We can remove the conditions that check for these flags and always use the code inside the conditions. --- shared/templates/sysctl/oval.template | 4 ---- shared/templates/sysctl/template.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/shared/templates/sysctl/oval.template b/shared/templates/sysctl/oval.template index 35a7e94d39e..dd34e10f8c5 100644 --- a/shared/templates/sysctl/oval.template +++ b/shared/templates/sysctl/oval.template @@ -62,7 +62,6 @@ {{%- endif %}} -{{%- if "R" in FLAGS -%}} {{% if CHECK_RUNTIME == "true" %}} @@ -121,8 +120,6 @@ {{% endif %}} -{{%- endif -%}} -{{%- if "S" in FLAGS -%}} @@ -269,4 +266,3 @@ {{% endfor %}} {{% endif %}} -{{%- endif -%}} diff --git a/shared/templates/sysctl/template.py b/shared/templates/sysctl/template.py index 23c6cc45d35..651fa0c0eb6 100644 --- a/shared/templates/sysctl/template.py +++ b/shared/templates/sysctl/template.py @@ -8,7 +8,7 @@ def preprocess(data, lang): ipv6_flag = "P" if data["sysctlid"].find("ipv6") >= 0: ipv6_flag = "I" - data["flags"] = "SR" + ipv6_flag + data["flags"] = ipv6_flag if "operation" not in data: data["operation"] = "equals" if isinstance(data["sysctlval"], list) and len(data["sysctlval"]) == 0: