mirror of
https://github.com/cwinfo/hyperboria-peers.git
synced 2024-11-22 07:10:27 +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
|
||||
"""Checks that the peering details in this repo conform to a few basic rules."""
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
@ -13,6 +14,7 @@ END = '\x1b[0m'
|
||||
|
||||
|
||||
def validate(path):
|
||||
"""Test a single set of peering creds."""
|
||||
print("Validating %s" % path)
|
||||
try:
|
||||
creds = open(path).read()
|
||||
@ -21,12 +23,12 @@ def validate(path):
|
||||
warning = False
|
||||
for host in hosts:
|
||||
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,
|
||||
field, END))
|
||||
return False
|
||||
for field in RECOMMENDED_FIELDS:
|
||||
if not field in peers[host]:
|
||||
if field not in peers[host]:
|
||||
warning = True
|
||||
print(" %sHost %s is missing the recommended field %s%s" % (YELLOW, host,
|
||||
field, END))
|
||||
|
Loading…
Reference in New Issue
Block a user