VPN: IPsec: Security Policy Database - refactor to MVC and extend functionality.

missed a spot in the previous commit, make sure we're not omitting host entries as they skip a subnet definition
This commit is contained in:
Ad Schellevis 2022-07-07 11:34:10 +02:00
parent 057fe2e7d2
commit 023d8e4a35
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ if __name__ == '__main__':
for line in sp.stdout.split("\n"):
line_no += 1
parts = line.split()
if not line.startswith("\t") and line.count('/') == 2:
if not line.startswith("\t") and len(parts) > 2:
line_no = 0
spec_line = line.strip()
spd_rec = {

View File

@ -40,7 +40,7 @@ if __name__ == '__main__':
sp = subprocess.run(['/sbin/setkey', '-DP'], capture_output=True, text=True)
spec_line = None
for line in sp.stdout.split("\n"):
if not line.startswith("\t") and line.count('/') == 2:
if not line.startswith("\t") and len(line.split()) > 2:
spec_line = line.strip()
elif spec_line:
ident = "%s %s" % (spec_line, line.strip().split()[0])