1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

fix model type annotations to make flake8 happy

This commit is contained in:
checktheroads
2020-07-13 02:18:26 -07:00
parent 10593de581
commit 8b02787aea
9 changed files with 43 additions and 20 deletions

View File

@@ -9,18 +9,21 @@ from pydantic import StrictStr, constr
# Project
from hyperglass.models import HyperglassModel
StructuredCommunityMode = constr(regex=r"(permit|deny)")
StructuredRPKIMode = constr(regex=r"(router|external)")
class StructuredCommunities(HyperglassModel):
"""Control structured data response for BGP communties."""
mode: constr(regex=r"(permit|deny)") = "deny"
mode: StructuredCommunityMode = "deny"
items: List[StrictStr] = []
class StructuredRpki(HyperglassModel):
"""Control structured data response for RPKI state."""
mode: constr(regex=r"(router|external)") = "router"
mode: StructuredRPKIMode = "router"
class Structured(HyperglassModel):