Update postfix audit
This commit is contained in:
@@ -11,8 +11,6 @@ class Parsing(ParsingBase):
|
||||
self._reports = dict()
|
||||
self._objects = objects
|
||||
self._postfix_file = arguments["postfix_file"]
|
||||
print(self._objects)
|
||||
print(arguments)
|
||||
|
||||
def runParsing(self):
|
||||
# Generate report
|
||||
@@ -30,9 +28,18 @@ class Parsing(ParsingBase):
|
||||
data = fdata.read()
|
||||
lines = data.splitlines()
|
||||
|
||||
obj = self._objects['regexp'].split("=")
|
||||
directive = obj[0].strip()
|
||||
value = obj[1].strip()
|
||||
print(self._objects)
|
||||
|
||||
for line in lines:
|
||||
line = line.decode('utf-8')
|
||||
print(line)
|
||||
grDirective = re.search(directive, line)
|
||||
if grDirective:
|
||||
grValue = re.search(value, line)
|
||||
if grValue:
|
||||
print(line)
|
||||
|
||||
def _generateReport(self, objects):
|
||||
# We can generate the report
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
def postfix() -> dict:
|
||||
postfix = dict()
|
||||
postfix['regexp'] = "inet_interfaces = all"
|
||||
postfix['replace'] = "inet_interfaces = loopback-only"
|
||||
def postfix() -> list:
|
||||
postfix = list()
|
||||
postfix.append({
|
||||
'directive': "inet_interfaces",
|
||||
'value': "loopback-only",
|
||||
})
|
||||
return postfix
|
||||
|
||||
Reference in New Issue
Block a user