feat: use custom type to handle existing naive datetimes
This commit is contained in:
parent
e22abb383c
commit
39bdac1ecf
45 changed files with 210 additions and 84 deletions
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
import stat
|
||||
from typing import Tuple, Any, Optional
|
||||
from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED
|
||||
from typing import Any, Optional, Tuple
|
||||
from zipfile import ZIP_DEFLATED, ZipFile, ZipInfo
|
||||
|
||||
import jinja2
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Tuple, Optional
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import boto3
|
||||
from sqlalchemy import func
|
||||
|
@ -6,8 +6,8 @@ from sqlalchemy import func
|
|||
from app import app
|
||||
from app.alarms import get_or_create_alarm
|
||||
from app.extensions import db
|
||||
from app.models.base import Group
|
||||
from app.models.alarms import AlarmState
|
||||
from app.models.base import Group
|
||||
from app.models.onions import Eotk
|
||||
from app.terraform import BaseAutomation
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ from app import app
|
|||
from app.alarms import get_or_create_alarm
|
||||
from app.brm.brn import BRN
|
||||
from app.extensions import db
|
||||
from app.models.mirrors import Proxy
|
||||
from app.models.alarms import AlarmState
|
||||
from app.models.mirrors import Proxy
|
||||
from app.terraform import BaseAutomation
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Tuple, Optional
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import boto3
|
||||
from sqlalchemy import func
|
||||
|
@ -6,8 +6,8 @@ from sqlalchemy import func
|
|||
from app import app
|
||||
from app.alarms import get_or_create_alarm
|
||||
from app.extensions import db
|
||||
from app.models.base import Group
|
||||
from app.models.alarms import AlarmState
|
||||
from app.models.base import Group
|
||||
from app.models.mirrors import SmartProxy
|
||||
from app.terraform import BaseAutomation
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from flask import current_app
|
||||
from github import Github
|
||||
|
||||
from app.terraform.block.bridge_reachability import BlockBridgeReachabilityAutomation
|
||||
from app.terraform.block.bridge_reachability import \
|
||||
BlockBridgeReachabilityAutomation
|
||||
|
||||
|
||||
class BlockBridgeGitHubAutomation(BlockBridgeReachabilityAutomation):
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from flask import current_app
|
||||
from gitlab import Gitlab
|
||||
|
||||
from app.terraform.block.bridge_reachability import BlockBridgeReachabilityAutomation
|
||||
from app.terraform.block.bridge_reachability import \
|
||||
BlockBridgeReachabilityAutomation
|
||||
|
||||
|
||||
class BlockBridgeGitlabAutomation(BlockBridgeReachabilityAutomation):
|
||||
|
|
|
@ -2,7 +2,7 @@ import json
|
|||
import logging
|
||||
from io import BytesIO
|
||||
from typing import Any, Optional
|
||||
from zipfile import ZipFile, BadZipFile
|
||||
from zipfile import BadZipFile, ZipFile
|
||||
|
||||
import lxml # nosec: B410
|
||||
import requests
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from collections.abc import Mapping, Sequence
|
||||
import json
|
||||
import os
|
||||
from typing import List, Any
|
||||
from collections.abc import Mapping, Sequence
|
||||
from typing import Any, List
|
||||
|
||||
from app import app
|
||||
from app.lists import lists
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import datetime
|
||||
import os.path
|
||||
import sys
|
||||
from abc import abstractmethod
|
||||
import datetime
|
||||
from collections import defaultdict
|
||||
from typing import Optional, Any, List, Dict
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from flask import current_app
|
||||
from sqlalchemy import text
|
||||
|
@ -11,7 +11,7 @@ from sqlalchemy import text
|
|||
from app import app
|
||||
from app.extensions import db
|
||||
from app.models.base import Group
|
||||
from app.models.mirrors import Proxy, Origin, SmartProxy
|
||||
from app.models.mirrors import Origin, Proxy, SmartProxy
|
||||
from app.terraform.terraform import TerraformAutomation
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Optional, Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from app.extensions import db
|
||||
from app.models.mirrors import Proxy
|
||||
|
|
|
@ -235,6 +235,7 @@ class ProxyMetaAutomation(BaseAutomation):
|
|||
"""
|
||||
pools = Pool.query.all()
|
||||
for pool in pools:
|
||||
logging.debug(pool.added < datetime.now(tz=timezone.utc))
|
||||
if pool.id == -1:
|
||||
continue # Skip hotspare pool
|
||||
logging.debug("Missing proxy check for %s", pool.pool_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue