From 4e05806826cc0a5797e6ff50e6a953ae15607c03 Mon Sep 17 00:00:00 2001 From: Watson Sato Date: Mon, 12 Oct 2020 14:22:02 +0200 Subject: [PATCH] Improve Bash machine platform check Fix ShellCheck warning SC2166, "-a" syntax is error prone. --- ssg/build_remediations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssg/build_remediations.py b/ssg/build_remediations.py index 572db61701..6759b6c963 100644 --- a/ssg/build_remediations.py +++ b/ssg/build_remediations.py @@ -290,7 +290,7 @@ def parse_from_file_with_jinja(self, env_yaml): for platform in rule_platforms: if platform == "machine": # Based on check installed_env_is_a_container - platform_conditionals.append('[ ! -f /.dockerenv -a ! -f /run/.containerenv ]') + platform_conditionals.append('[ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]') elif platform is not None: # Assume any other platform is a Package CPE