mirror of
https://github.com/cwinfo/hyperboria-peers.git
synced 2024-11-22 18:40:28 +00:00
Make whatever crazy python linter I installed happy
This commit is contained in:
parent
78b0e03cb4
commit
8a63833742
6
tests.py
6
tests.py
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
"""Checks that the peering details in this repo conform to a few basic rules."""
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@ -13,6 +14,7 @@ END = '\x1b[0m'
|
|||||||
|
|
||||||
|
|
||||||
def validate(path):
|
def validate(path):
|
||||||
|
"""Test a single set of peering creds."""
|
||||||
print("Validating %s" % path)
|
print("Validating %s" % path)
|
||||||
try:
|
try:
|
||||||
creds = open(path).read()
|
creds = open(path).read()
|
||||||
@ -21,12 +23,12 @@ def validate(path):
|
|||||||
warning = False
|
warning = False
|
||||||
for host in hosts:
|
for host in hosts:
|
||||||
for field in REQUIRED_FIELDS:
|
for field in REQUIRED_FIELDS:
|
||||||
if not field in peers[host]:
|
if field not in peers[host]:
|
||||||
print(" %sHost %s is missing the required field %s%s" % (RED, host,
|
print(" %sHost %s is missing the required field %s%s" % (RED, host,
|
||||||
field, END))
|
field, END))
|
||||||
return False
|
return False
|
||||||
for field in RECOMMENDED_FIELDS:
|
for field in RECOMMENDED_FIELDS:
|
||||||
if not field in peers[host]:
|
if field not in peers[host]:
|
||||||
warning = True
|
warning = True
|
||||||
print(" %sHost %s is missing the recommended field %s%s" % (YELLOW, host,
|
print(" %sHost %s is missing the recommended field %s%s" % (YELLOW, host,
|
||||||
field, END))
|
field, END))
|
||||||
|
Loading…
Reference in New Issue
Block a user