From b74038ca635d5196dbf6c55000ff4a474a9eab3b Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Fri, 25 Feb 2022 12:20:39 +0300 Subject: [PATCH] Fix typing issues in push-backup --- build/worker/push_backup.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/worker/push_backup.py b/build/worker/push_backup.py index 6d57a88f..f8f0248c 100755 --- a/build/worker/push_backup.py +++ b/build/worker/push_backup.py @@ -3,7 +3,7 @@ import argparse import os import sys -from typing import List +from typing import Any, List, cast import boto3 import frappe @@ -31,14 +31,17 @@ def get_bucket(arguments: Arguments): def get_files(site_name: str): frappe.connect(site_name) + + conf = cast(Any, frappe.conf) backup_generator = BackupGenerator( - db_name=frappe.conf.db_name, - user=frappe.conf.db_name, - password=frappe.conf.db_password, + db_name=conf.db_name, + user=conf.db_name, + password=conf.db_password, db_host=frappe.db.host, db_port=frappe.db.port, - db_type=frappe.conf.db_type, + db_type=conf.db_type, ) + recent_backup_files = backup_generator.get_recent_backup(24) return [f for f in recent_backup_files if f]