From eae05e83e672a0fe34eecc47f3a4e3db646a6a77 Mon Sep 17 00:00:00 2001 From: Wes Date: Tue, 13 Dec 2022 16:28:50 +0000 Subject: [PATCH] Use new list verification function for 'file_path' --- salt/sensoroni/files/analyzers/localfile/localfile.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/salt/sensoroni/files/analyzers/localfile/localfile.py b/salt/sensoroni/files/analyzers/localfile/localfile.py index 5538d6a93..8dbc2b163 100755 --- a/salt/sensoroni/files/analyzers/localfile/localfile.py +++ b/salt/sensoroni/files/analyzers/localfile/localfile.py @@ -1,18 +1,10 @@ import json import helpers import os -import sys import argparse import csv -def checkConfigRequirements(conf): - if "file_path" not in conf or len(conf['file_path']) == 0: - sys.exit(126) - else: - return True - - def searchFile(artifact, csvfiles): dir = os.path.dirname(os.path.realpath(__file__)) found = [] @@ -54,7 +46,7 @@ def prepareResults(raw): def analyze(conf, input): - checkConfigRequirements(conf) + helpers.verifyNonEmptyListValue(conf, 'file_path') meta = helpers.loadMetadata(__file__) data = helpers.parseArtifact(input) helpers.checkSupportedType(meta, data["artifactType"])