mirror of
https://github.com/thatmattlove/hyperglass.git
synced 2026-01-17 08:48:05 +00:00
Remove unused imports, fix syntax errors
This commit is contained in:
parent
7e0bea6a38
commit
e940195631
1 changed files with 15 additions and 11 deletions
|
|
@ -7,21 +7,15 @@ Validates input for overridden parameters.
|
|||
"""
|
||||
import re
|
||||
from math import ceil
|
||||
from typing import Dict, List, Optional, Tuple, Union
|
||||
from typing import List, Union
|
||||
from ipaddress import IPv4Address, IPv6Address
|
||||
from pathlib import Path
|
||||
|
||||
from pydantic import (
|
||||
BaseSettings,
|
||||
ConstrainedStr,
|
||||
DirectoryPath,
|
||||
FilePath,
|
||||
IPvAnyNetwork,
|
||||
IPvAnyAddress,
|
||||
UrlStr,
|
||||
constr,
|
||||
validator,
|
||||
create_model,
|
||||
SecretStr,
|
||||
)
|
||||
from pydantic.color import Color
|
||||
|
|
@ -71,6 +65,7 @@ class Router(BaseSettings):
|
|||
class Routers(BaseSettings):
|
||||
"""Base model for devices class."""
|
||||
|
||||
@staticmethod
|
||||
def build_network_lists(valid_devices):
|
||||
"""
|
||||
Builds locations dict, which is converted to JSON and passed to
|
||||
|
|
@ -108,7 +103,7 @@ class Routers(BaseSettings):
|
|||
return (locations_dict, networks_dict)
|
||||
|
||||
@classmethod
|
||||
def import_params(Routers, input_params):
|
||||
def import_params(cls, input_params):
|
||||
"""
|
||||
Imports passed dict from YAML config, removes unsupported
|
||||
characters from device names, dynamically sets attributes for
|
||||
|
|
@ -132,6 +127,8 @@ class Routers(BaseSettings):
|
|||
class Config:
|
||||
"""Pydantic Config"""
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
||||
validate_all = True
|
||||
validate_assignment = True
|
||||
|
||||
|
|
@ -147,7 +144,7 @@ class Credentials(BaseSettings):
|
|||
"""Base model for credentials class"""
|
||||
|
||||
@classmethod
|
||||
def import_params(Credentials, input_params):
|
||||
def import_params(cls, input_params):
|
||||
"""
|
||||
Imports passed dict from YAML config, removes unsupported
|
||||
characters from device names, dynamically sets attributes for
|
||||
|
|
@ -162,6 +159,8 @@ class Credentials(BaseSettings):
|
|||
class Config:
|
||||
"""Pydantic Config"""
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
||||
validate_all = True
|
||||
validate_assignment = True
|
||||
|
||||
|
|
@ -187,7 +186,7 @@ class Proxies(BaseSettings):
|
|||
"""Base model for proxies class"""
|
||||
|
||||
@classmethod
|
||||
def import_params(Proxies, input_params):
|
||||
def import_params(cls, input_params):
|
||||
"""
|
||||
Imports passed dict from YAML config, removes unsupported
|
||||
characters from device names, dynamically sets attributes for
|
||||
|
|
@ -202,6 +201,8 @@ class Proxies(BaseSettings):
|
|||
class Config:
|
||||
"""Pydantic Config"""
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
||||
validate_all = True
|
||||
validate_assignment = True
|
||||
|
||||
|
|
@ -476,6 +477,7 @@ class Params(BaseSettings):
|
|||
class Config:
|
||||
"""Pydantic Config"""
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
validate_all = True
|
||||
validate_assignment = True
|
||||
|
||||
|
|
@ -512,7 +514,7 @@ class Commands(BaseSettings):
|
|||
"""Base class for commands class"""
|
||||
|
||||
@classmethod
|
||||
def import_params(Commands, input_params):
|
||||
def import_params(cls, input_params):
|
||||
"""
|
||||
Imports passed dict from YAML config, dynamically sets
|
||||
attributes for the commands class.
|
||||
|
|
@ -622,5 +624,7 @@ class Commands(BaseSettings):
|
|||
class Config:
|
||||
"""Pydantic Config"""
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
|
||||
validate_all = False
|
||||
validate_assignment = True
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue