def hash_file(filenames):
    """Returns md5sum of passed in file. If a list of files is passed,
    they are concatenated together and hashed.
    Remove "default-rule-path" from Suricata config since this
    changes every job.
    """
    if not isinstance(filenames, list):
        filenames = [filenames]
    hash = hashlib.md5()
    for filename in filenames:
        if not os.path.isfile(filename):
            logger.error(f"in hash_file(): file '{filename}' does not exit.")
            raise
        if filename.endswith(".yaml"):
            # remove "default-rule-path:" line
            with open(filename, "r") as fh:
                lines = fh.readlines()
                hash.update(
                    "".join(
                        [
                            line
                            for line in lines
                            if not line.startswith("default-rule-path:")
                        ]
                    ).encode("utf-8")
                )
        else:
            with open(filename, "rb") as fh:
                data = fh.read(65536)
                while len(data) > 0:
                    hash.update(data)
                    data = fh.read(65536)
    return hash.hexdigest()
Returns md5sum of passed in file. If a list of files is passed,
    they are concatenated together and hashed.
    Remove "default-rule-path" from Suricata config since this
    changes every job.
    
dalton-agent/dalton-agent.py