From ea317ccdc00a50490d4e14cb00744ede03b41019 Mon Sep 17 00:00:00 2001 From: Lori Jakab Date: Thu, 14 Mar 2024 13:30:26 +0100 Subject: [PATCH] config_builder: Pydantic 2 quick fix --- sdwan_config_builder/requirements.txt | 2 +- .../src/sdwan_config_builder/loader/__init__.py | 2 +- sdwan_config_builder/src/sdwan_config_builder/loader/models.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdwan_config_builder/requirements.txt b/sdwan_config_builder/requirements.txt index f5f217f..1792b6d 100644 --- a/sdwan_config_builder/requirements.txt +++ b/sdwan_config_builder/requirements.txt @@ -1,4 +1,4 @@ -pydantic>=1.10,<2 +pydantic>=2 PyYAML>=6.0 Jinja2>=3.1 passlib>=1.7.4 diff --git a/sdwan_config_builder/src/sdwan_config_builder/loader/__init__.py b/sdwan_config_builder/src/sdwan_config_builder/loader/__init__.py index bd010ea..b68e3fe 100644 --- a/sdwan_config_builder/src/sdwan_config_builder/loader/__init__.py +++ b/sdwan_config_builder/src/sdwan_config_builder/loader/__init__.py @@ -2,7 +2,7 @@ import sys import yaml from typing import Any, TypeVar, Type, Union, List -from pydantic import BaseModel, ValidationError +from pydantic.v1 import BaseModel, ValidationError from .models import ConfigModel diff --git a/sdwan_config_builder/src/sdwan_config_builder/loader/models.py b/sdwan_config_builder/src/sdwan_config_builder/loader/models.py index 42b182b..88ac519 100644 --- a/sdwan_config_builder/src/sdwan_config_builder/loader/models.py +++ b/sdwan_config_builder/src/sdwan_config_builder/loader/models.py @@ -4,7 +4,7 @@ from enum import Enum from pathlib import Path from ipaddress import IPv4Network, IPv6Network, IPv4Interface, IPv4Address -from pydantic import BaseModel, BaseSettings, Field, validator, root_validator, constr, conint +from pydantic.v1 import BaseModel, BaseSettings, Field, validator, root_validator, constr, conint from passlib.hash import sha512_crypt from sshpubkeys import SSHKey, InvalidKeyError from .validators import (formatted_string, unique_system_ip, constrained_cidr, cidr_subnet, subnet_interface,