/usr/share/pyshared/atheist/plugins/FileContainsRE.py is in atheist 0.20110402-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # -*- coding:utf-8; tab-width:4; mode:python -*-
import re
import atheist
class FileContainsRE(atheist.FileContains, atheist.Plugin):
def run(self):
try:
return atheist.FileContains.run(self)
except re.error, e:
atheist.Log.warning(e)
return atheist.const.ERROR
@classmethod
def check(cls, expected, content):
pattern = re.compile(expected)
return len(pattern.findall(content))
|