From e96206d065a7cb7a23a671f5fab002b4c8d6e811 Mon Sep 17 00:00:00 2001 From: Wes Lambert Date: Tue, 5 Jul 2022 14:25:54 +0000 Subject: [PATCH] Strip quotes and ensure file_path is typed as a list --- salt/sensoroni/files/analyzers/localfile/localfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/sensoroni/files/analyzers/localfile/localfile.py b/salt/sensoroni/files/analyzers/localfile/localfile.py index 5538d6a93..0924a98cc 100755 --- a/salt/sensoroni/files/analyzers/localfile/localfile.py +++ b/salt/sensoroni/files/analyzers/localfile/localfile.py @@ -17,7 +17,7 @@ def searchFile(artifact, csvfiles): dir = os.path.dirname(os.path.realpath(__file__)) found = [] for f in csvfiles: - filename = dir + "/" + f + filename = dir + "/" + f.strip("'") with open(filename, "r") as csvfile: csvdata = csv.DictReader(csvfile) for row in csvdata: @@ -58,7 +58,7 @@ def analyze(conf, input): meta = helpers.loadMetadata(__file__) data = helpers.parseArtifact(input) helpers.checkSupportedType(meta, data["artifactType"]) - search = searchFile(data["value"], conf['file_path']) + search = searchFile(data["value"], conf['file_path'].strip("[]").split(', ')) results = prepareResults(search) return results