From 097467eebc762caf3bcaef58b676ed17645e705e Mon Sep 17 00:00:00 2001 From: Oleksandr Kuzminskyi Date: Sat, 14 Sep 2024 13:02:35 -0700 Subject: [PATCH 1/5] Sunset CentOS 7 -- EOL --- .github/workflows/intergration-tests.yml | 2 +- support/bootstrap/storage_server.sh | 9 ++++----- tests/integration/conftest.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/intergration-tests.yml b/.github/workflows/intergration-tests.yml index c7a575b9..41d26c22 100644 --- a/.github/workflows/intergration-tests.yml +++ b/.github/workflows/intergration-tests.yml @@ -21,7 +21,7 @@ jobs: PAUSE_TEST: "${{ inputs.pause_test }}" strategy: matrix: - version: ["focal", "jammy", "7"] + version: ["focal", "jammy"] steps: - uses: "actions/checkout@v3" - name: "Setup Python env" diff --git a/support/bootstrap/storage_server.sh b/support/bootstrap/storage_server.sh index 391cc56f..9f5154dd 100644 --- a/support/bootstrap/storage_server.sh +++ b/support/bootstrap/storage_server.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash set -exu -yum clean all +apt-get update function install_package() { for _ in 1 2 3 do # shellcheck disable=SC2068 - yum -y install $@ && break + apt-get -y install $@ && break sleep 5 done } @@ -21,6 +21,7 @@ function start_sshd() { /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -P "" fi + mkdir -p /run/sshd mkdir -p /root/.ssh/ /bin/chown root:root /root/.ssh /bin/chmod 700 /root/.ssh/ @@ -33,11 +34,9 @@ function start_sshd() { } -rpm -q epel-release || install_package epel-release install_package \ openssh-server \ - nc \ + netcat \ sudo - start_sshd diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 086f8fca..2755397c 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -372,7 +372,7 @@ def storage_server(docker_client, container_network): docker_client, container_network, last_n=3, - image="centos:centos7", + image="ubuntu:jammy", command=["bash", bootstrap_script], ) # docker_execute(docker_client, container["id"], ["bash", bootstrap_script]) From 31b54bbe1a5af40b5c74dea30d7ea771546f291e Mon Sep 17 00:00:00 2001 From: Oleksandr Kuzminskyi Date: Sat, 14 Sep 2024 13:04:09 -0700 Subject: [PATCH 2/5] Upgrade requirements --- requirements.txt | 65 +++++++++++++++++--------------- requirements_dev.txt | 90 ++++++++++++++++++++++---------------------- 2 files changed, 78 insertions(+), 77 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3282cfee..e60b22f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,65 +1,65 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements.txt requirements.in # -azure-core==1.29.4 +azure-core==1.31.0 # via # -r requirements.in # azure-storage-blob -azure-storage-blob==12.18.3 +azure-storage-blob==12.22.0 # via -r requirements.in -bcrypt==4.0.1 +bcrypt==4.2.0 # via paramiko -beautifulsoup4==4.12.2 +beautifulsoup4==4.12.3 # via google -boto3==1.28.66 +boto3==1.35.19 # via -r requirements.in -botocore==1.31.66 +botocore==1.35.19 # via # boto3 # s3transfer -cachetools==5.3.1 +cachetools==5.5.0 # via google-auth -certifi==2023.7.22 +certifi==2024.8.30 # via requests -cffi==1.16.0 +cffi==1.17.1 # via # cryptography # pynacl -charset-normalizer==3.3.0 +charset-normalizer==3.3.2 # via requests click==8.1.7 # via -r requirements.in -cryptography==41.0.4 +cryptography==43.0.1 # via # azure-storage-blob # paramiko -datadog==0.47.0 +datadog==0.50.0 # via -r requirements.in google==3.0.0 # via -r requirements.in -google-api-core==2.12.0 +google-api-core==2.19.2 # via # google-cloud-core # google-cloud-storage -google-auth==2.23.3 +google-auth==2.34.0 # via # google-api-core # google-cloud-core # google-cloud-storage -google-cloud-core==2.3.3 +google-cloud-core==2.4.1 # via google-cloud-storage google-cloud-storage==2.3.0 # via -r requirements.in google-crc32c==1.5.0 # via google-resumable-media -google-resumable-media==2.6.0 +google-resumable-media==2.7.2 # via google-cloud-storage -googleapis-common-protos==1.61.0 +googleapis-common-protos==1.65.0 # via google-api-core -idna==3.4 +idna==3.9 # via requests isodate==0.6.1 # via azure-storage-blob @@ -69,29 +69,32 @@ jmespath==1.0.1 # botocore paramiko==2.12.0 # via -r requirements.in -protobuf==4.24.4 +proto-plus==1.24.0 + # via google-api-core +protobuf==5.28.1 # via # google-api-core # google-cloud-storage # googleapis-common-protos -psutil==5.9.6 + # proto-plus +psutil==5.9.8 # via -r requirements.in -pyasn1==0.5.0 +pyasn1==0.6.1 # via # -r requirements.in # pyasn1-modules # rsa -pyasn1-modules==0.3.0 +pyasn1-modules==0.4.1 # via google-auth -pycparser==2.21 +pycparser==2.22 # via cffi -pymysql==1.1.0 +pymysql==1.1.1 # via -r requirements.in pynacl==1.5.0 # via paramiko -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via botocore -requests==2.31.0 +requests==2.32.3 # via # azure-core # datadog @@ -99,7 +102,7 @@ requests==2.31.0 # google-cloud-storage rsa==4.9 # via google-auth -s3transfer==0.7.0 +s3transfer==0.10.2 # via boto3 six==1.16.0 # via @@ -107,17 +110,17 @@ six==1.16.0 # isodate # paramiko # python-dateutil -soupsieve==2.5 +soupsieve==2.6 # via beautifulsoup4 statsd==3.3.0 # via -r requirements.in statsd-tags==3.2.1.post1 # via -r requirements.in -typing-extensions==4.8.0 +typing-extensions==4.12.2 # via # azure-core # azure-storage-blob -urllib3==1.26.18 +urllib3==1.26.20 # via # botocore # requests diff --git a/requirements_dev.txt b/requirements_dev.txt index d624b925..e8dd86fe 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # pip-compile --output-file=requirements_dev.txt requirements_dev.in @@ -8,13 +8,13 @@ alabaster==0.7.13 # via sphinx astroid==2.15.8 # via pylint -babel==2.13.0 +babel==2.16.0 # via sphinx black==22.12.0 # via -r requirements_dev.in -boto3==1.28.66 +boto3==1.35.19 # via moto -botocore==1.31.66 +botocore==1.35.19 # via # boto3 # moto @@ -23,43 +23,41 @@ bump2version==1.0.1 # via bumpversion bumpversion==0.6.0 # via -r requirements_dev.in -certifi==2023.7.22 +certifi==2024.8.30 # via requests -cffi==1.16.0 +cffi==1.17.1 # via cryptography -charset-normalizer==3.3.0 +charset-normalizer==3.3.2 # via requests click==8.1.7 # via # black # runlike -coverage[toml]==7.3.2 - # via - # coverage - # pytest-cov -cryptography==41.0.4 +coverage[toml]==7.6.1 + # via pytest-cov +cryptography==43.0.1 # via moto -dill==0.3.7 +dill==0.3.8 # via pylint docker==5.0.3 # via -r requirements_dev.in docutils==0.17.1 # via sphinx -exceptiongroup==1.1.3 +exceptiongroup==1.2.2 # via pytest -idna==3.4 +idna==3.9 # via requests imagesize==1.4.1 # via sphinx -importlib-metadata==6.8.0 +importlib-metadata==8.5.0 # via sphinx iniconfig==2.0.0 # via pytest -isort==5.12.0 +isort==5.13.2 # via # -r requirements_dev.in # pylint -jinja2==3.1.2 +jinja2==3.1.4 # via # moto # sphinx @@ -67,9 +65,9 @@ jmespath==1.0.1 # via # boto3 # botocore -lazy-object-proxy==1.9.0 +lazy-object-proxy==1.10.0 # via astroid -markupsafe==2.1.3 +markupsafe==2.1.5 # via # jinja2 # werkzeug @@ -77,62 +75,64 @@ mccabe==0.7.0 # via pylint mock==4.0.3 # via -r requirements_dev.in -moto==4.2.6 +moto==4.2.14 # via -r requirements_dev.in mypy-extensions==1.0.0 # via black -packaging==23.2 +packaging==24.1 # via # pytest # sphinx -pathspec==0.11.2 +pathspec==0.12.1 # via # black # yamllint -platformdirs==3.11.0 +platformdirs==4.3.3 # via # black # pylint -pluggy==1.3.0 +pluggy==1.5.0 # via pytest -pycodestyle==2.11.1 +pycodestyle==2.12.1 # via -r requirements_dev.in -pycparser==2.21 +pycparser==2.22 # via cffi -pygments==2.16.1 +pygments==2.18.0 # via sphinx pylint==2.17.7 # via -r requirements_dev.in -pytest==7.4.2 +pytest==7.4.4 # via # -r requirements_dev.in # pytest-cov # pytest-timeout pytest-cov==3.0.0 # via -r requirements_dev.in -pytest-timeout==2.2.0 +pytest-timeout==2.3.1 # via -r requirements_dev.in -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # botocore # moto python-magic==0.4.18 # via -r requirements_dev.in -pyyaml==6.0.1 +pytz==2024.2 + # via babel +pyyaml==6.0.2 # via # responses # yamllint -requests==2.31.0 +requests==2.32.3 # via # docker # moto # responses # sphinx -responses==0.23.3 +responses==0.25.3 # via moto -runlike==1.4.9 +runlike==1.4.14 # via -r requirements_dev.in -s3transfer==0.7.0 +s3transfer==0.10.2 # via boto3 six==1.16.0 # via python-dateutil @@ -158,29 +158,27 @@ tomli==2.0.1 # coverage # pylint # pytest -tomlkit==0.12.1 +tomlkit==0.13.2 # via pylint -types-pyyaml==6.0.12.12 - # via responses -typing-extensions==4.8.0 +typing-extensions==4.12.2 # via # astroid # black # pylint -urllib3==1.26.18 +urllib3==1.26.20 # via # botocore # requests # responses -websocket-client==1.6.4 +websocket-client==1.8.0 # via docker -werkzeug==3.0.0 +werkzeug==3.0.4 # via moto -wrapt==1.15.0 +wrapt==1.16.0 # via astroid xmltodict==0.13.0 # via moto -yamllint==1.32.0 +yamllint==1.35.1 # via -r requirements_dev.in -zipp==3.17.0 +zipp==3.20.2 # via importlib-metadata From 3f4e8ae4c943f772a3307ff7d3f53328264e2102 Mon Sep 17 00:00:00 2001 From: Oleksandr Kuzminskyi Date: Sat, 14 Sep 2024 13:07:56 -0700 Subject: [PATCH 3/5] Upgrade requirements/2 --- requirements.in | 2 +- requirements.txt | 3 +-- requirements_dev.in | 2 +- requirements_dev.txt | 3 ++- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.in b/requirements.in index eac6f4bb..e6825b86 100644 --- a/requirements.in +++ b/requirements.in @@ -7,7 +7,7 @@ boto3 ~= 1.7 psutil ~= 5.4 pyasn1 ~= 0.4 datadog ~= 0.22 -paramiko ~= 2.5 +paramiko ~= 3.4 google ~= 3.0 google-cloud-storage ~= 2.3.0 statsd ~= 3.3 diff --git a/requirements.txt b/requirements.txt index e60b22f6..8258a2ce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -67,7 +67,7 @@ jmespath==1.0.1 # via # boto3 # botocore -paramiko==2.12.0 +paramiko==3.4.1 # via -r requirements.in proto-plus==1.24.0 # via google-api-core @@ -108,7 +108,6 @@ six==1.16.0 # via # azure-core # isodate - # paramiko # python-dateutil soupsieve==2.6 # via beautifulsoup4 diff --git a/requirements_dev.in b/requirements_dev.in index a12322d0..19823179 100644 --- a/requirements_dev.in +++ b/requirements_dev.in @@ -1,5 +1,5 @@ #@IgnoreInspection BashAddShebang -black ~= 22.3 +black ~= 24.3 Sphinx ~= 4.5 bumpversion ~= 0.6 docker ~= 5.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index e8dd86fe..2ace724f 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -10,7 +10,7 @@ astroid==2.15.8 # via pylint babel==2.16.0 # via sphinx -black==22.12.0 +black==24.8.0 # via -r requirements_dev.in boto3==1.35.19 # via moto @@ -81,6 +81,7 @@ mypy-extensions==1.0.0 # via black packaging==24.1 # via + # black # pytest # sphinx pathspec==0.12.1 From 1e5ce373cd1d39cf80caba999891bd73a88e8e72 Mon Sep 17 00:00:00 2001 From: Oleksandr Kuzminskyi Date: Sat, 14 Sep 2024 13:12:55 -0700 Subject: [PATCH 4/5] Show what black wants to reformat --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6f4068f0..ddf65fc4 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ isort: ## Fix import order errors lint: ## check style with pylint yamllint --no-warnings -f parsable . isort --check-only twindb_backup tests - black --check twindb_backup tests + black --diff --check twindb_backup tests pycodestyle twindb_backup pylint twindb_backup From ae7ea98d717ae8953b81618c27775e9c6a03b523 Mon Sep 17 00:00:00 2001 From: Oleksandr Kuzminskyi Date: Sat, 14 Sep 2024 13:24:45 -0700 Subject: [PATCH 5/5] fix black errors --- tests/unit/source/file_source/test_get_stream.py | 1 + tests/unit/status/mysql_status/test_full_copy_exists.py | 4 ++-- .../dummy_content_generation/dino_namegen.py | 1 + twindb_backup/cache/cache.py | 1 + twindb_backup/cache/exceptions.py | 1 + twindb_backup/clone.py | 1 + twindb_backup/configuration/compression.py | 1 + twindb_backup/configuration/exceptions.py | 1 + twindb_backup/configuration/mysql.py | 1 + twindb_backup/configuration/retention.py | 1 + twindb_backup/configuration/run_intervals.py | 1 + twindb_backup/copy/exceptions.py | 1 + twindb_backup/copy/file_copy.py | 1 + twindb_backup/copy/mysql_copy.py | 1 + twindb_backup/copy/periodic_copy.py | 1 + twindb_backup/destination/exceptions.py | 1 + twindb_backup/exporter/exceptions.py | 1 + twindb_backup/modifiers/__init__.py | 1 + twindb_backup/modifiers/exceptions.py | 1 + twindb_backup/source/binlog_source.py | 1 + twindb_backup/source/exceptions.py | 1 + twindb_backup/source/mariadb_source.py | 1 + twindb_backup/source/mysql_source.py | 1 + twindb_backup/source/remote_mariadb_source.py | 1 + twindb_backup/ssh/client.py | 1 + twindb_backup/ssh/exceptions.py | 1 + twindb_backup/status/base_status.py | 1 + twindb_backup/status/binlog_status.py | 1 + twindb_backup/status/exceptions.py | 1 + twindb_backup/status/mysql_status.py | 1 + twindb_backup/status/periodic_status.py | 1 + 31 files changed, 32 insertions(+), 2 deletions(-) diff --git a/tests/unit/source/file_source/test_get_stream.py b/tests/unit/source/file_source/test_get_stream.py index ec8803c9..27e4ec93 100644 --- a/tests/unit/source/file_source/test_get_stream.py +++ b/tests/unit/source/file_source/test_get_stream.py @@ -1,4 +1,5 @@ """Tests that cover the FileSource().get_stream() method.""" + import mock import pytest diff --git a/tests/unit/status/mysql_status/test_full_copy_exists.py b/tests/unit/status/mysql_status/test_full_copy_exists.py index e0b7d18a..06cd198b 100644 --- a/tests/unit/status/mysql_status/test_full_copy_exists.py +++ b/tests/unit/status/mysql_status/test_full_copy_exists.py @@ -79,7 +79,7 @@ "monthly": {}, "yearly": {}, }, - False # Because daily backup type is incremental and + False, # Because daily backup type is incremental and # weekly is incremental ), ( @@ -92,7 +92,7 @@ "monthly": {}, "yearly": {}, }, - True # Because weekly backup type is incremental but + True, # Because weekly backup type is incremental but # weekly is full ), ( diff --git a/tests/unittests/excluded_env_config/dummy_content_generation/dino_namegen.py b/tests/unittests/excluded_env_config/dummy_content_generation/dino_namegen.py index c653d54a..25924755 100644 --- a/tests/unittests/excluded_env_config/dummy_content_generation/dino_namegen.py +++ b/tests/unittests/excluded_env_config/dummy_content_generation/dino_namegen.py @@ -1,5 +1,6 @@ """Filler content generator. code inspired by that used to create the site: https://www.fantasynamegenerators.com/dinosaur-names.php""" + import multiprocessing as mp from itertools import combinations from multiprocessing import Queue diff --git a/twindb_backup/cache/cache.py b/twindb_backup/cache/cache.py index b9945fc4..25ee4f8d 100644 --- a/twindb_backup/cache/cache.py +++ b/twindb_backup/cache/cache.py @@ -1,4 +1,5 @@ """Backup copy cache""" + import os import shutil diff --git a/twindb_backup/cache/exceptions.py b/twindb_backup/cache/exceptions.py index eca359df..1dea5731 100644 --- a/twindb_backup/cache/exceptions.py +++ b/twindb_backup/cache/exceptions.py @@ -1,4 +1,5 @@ """TwinDB Backup cache exceptions.""" + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/clone.py b/twindb_backup/clone.py index 53c37b38..8954474a 100644 --- a/twindb_backup/clone.py +++ b/twindb_backup/clone.py @@ -1,6 +1,7 @@ """ Module defines clone feature """ + import hashlib from contextlib import contextmanager from multiprocessing import Process diff --git a/twindb_backup/configuration/compression.py b/twindb_backup/configuration/compression.py index ba33a32a..a5cad5f0 100644 --- a/twindb_backup/configuration/compression.py +++ b/twindb_backup/configuration/compression.py @@ -1,4 +1,5 @@ """Compression configuration""" + from twindb_backup.configuration.exceptions import ConfigurationError from twindb_backup.modifiers import COMPRESSION_MODIFIERS diff --git a/twindb_backup/configuration/exceptions.py b/twindb_backup/configuration/exceptions.py index ecb9ecab..54037c3e 100644 --- a/twindb_backup/configuration/exceptions.py +++ b/twindb_backup/configuration/exceptions.py @@ -1,4 +1,5 @@ """TwinDB Backup configuration exceptions.""" + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/configuration/mysql.py b/twindb_backup/configuration/mysql.py index 38111a02..e4d8b180 100644 --- a/twindb_backup/configuration/mysql.py +++ b/twindb_backup/configuration/mysql.py @@ -1,4 +1,5 @@ """MySQL instance configuration""" + from twindb_backup import INTERVALS diff --git a/twindb_backup/configuration/retention.py b/twindb_backup/configuration/retention.py index 7e6d8b65..d2fbe551 100644 --- a/twindb_backup/configuration/retention.py +++ b/twindb_backup/configuration/retention.py @@ -1,4 +1,5 @@ """Retention policy configuration""" + from collections import namedtuple RetentionPolicy = namedtuple("RetentionPolicy", ["hourly", "daily", "weekly", "monthly", "yearly"]) diff --git a/twindb_backup/configuration/run_intervals.py b/twindb_backup/configuration/run_intervals.py index a2d8771c..afc1f27b 100644 --- a/twindb_backup/configuration/run_intervals.py +++ b/twindb_backup/configuration/run_intervals.py @@ -1,4 +1,5 @@ """Run policy configuration""" + from collections import namedtuple from twindb_backup import INTERVALS diff --git a/twindb_backup/copy/exceptions.py b/twindb_backup/copy/exceptions.py index 8eaf8130..0f86d9dd 100644 --- a/twindb_backup/copy/exceptions.py +++ b/twindb_backup/copy/exceptions.py @@ -1,4 +1,5 @@ """Module for Backup copy exception classes.""" + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/copy/file_copy.py b/twindb_backup/copy/file_copy.py index 3e90eb18..da806181 100644 --- a/twindb_backup/copy/file_copy.py +++ b/twindb_backup/copy/file_copy.py @@ -1,6 +1,7 @@ """ This module describes class to work with backup copies of the file type. """ + from twindb_backup.copy.periodic_copy import PeriodicCopy diff --git a/twindb_backup/copy/mysql_copy.py b/twindb_backup/copy/mysql_copy.py index f68a2f72..ae2eb306 100644 --- a/twindb_backup/copy/mysql_copy.py +++ b/twindb_backup/copy/mysql_copy.py @@ -1,4 +1,5 @@ """Class to describe MySQL backup copy""" + import json from twindb_backup import MARIABACKUP_BINARY, MBSTREAM_BINARY, XBSTREAM_BINARY, XTRABACKUP_BINARY diff --git a/twindb_backup/copy/periodic_copy.py b/twindb_backup/copy/periodic_copy.py index 69caeb4f..56f8a08b 100644 --- a/twindb_backup/copy/periodic_copy.py +++ b/twindb_backup/copy/periodic_copy.py @@ -1,4 +1,5 @@ """Interval class for a backup copy""" + from twindb_backup import INTERVALS from twindb_backup.copy.base_copy import BaseCopy from twindb_backup.copy.exceptions import WrongInputData diff --git a/twindb_backup/destination/exceptions.py b/twindb_backup/destination/exceptions.py index 98916449..09d93fae 100644 --- a/twindb_backup/destination/exceptions.py +++ b/twindb_backup/destination/exceptions.py @@ -1,6 +1,7 @@ """ Module for destination exceptions. """ + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/exporter/exceptions.py b/twindb_backup/exporter/exceptions.py index 2b464c88..36655cf9 100644 --- a/twindb_backup/exporter/exceptions.py +++ b/twindb_backup/exporter/exceptions.py @@ -1,6 +1,7 @@ """ Module for exporters exceptions. """ + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/modifiers/__init__.py b/twindb_backup/modifiers/__init__.py index b52b5dfb..227e4baf 100644 --- a/twindb_backup/modifiers/__init__.py +++ b/twindb_backup/modifiers/__init__.py @@ -6,6 +6,7 @@ Modifiers also do reverse operation - i.e. decompress, decrypt. """ + from twindb_backup.modifiers.bzip2 import Bzip2 from twindb_backup.modifiers.gzip import Gzip from twindb_backup.modifiers.lbzip2 import Lbzip2 diff --git a/twindb_backup/modifiers/exceptions.py b/twindb_backup/modifiers/exceptions.py index 83fef661..130c6f5b 100644 --- a/twindb_backup/modifiers/exceptions.py +++ b/twindb_backup/modifiers/exceptions.py @@ -1,4 +1,5 @@ """Modifier exceptions.""" + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/source/binlog_source.py b/twindb_backup/source/binlog_source.py index 3e7edb15..8778d77f 100644 --- a/twindb_backup/source/binlog_source.py +++ b/twindb_backup/source/binlog_source.py @@ -1,6 +1,7 @@ """ Module defines MySQL binlog source class for backing them up. """ + import struct from contextlib import contextmanager from os import path as osp diff --git a/twindb_backup/source/exceptions.py b/twindb_backup/source/exceptions.py index 17fc0bd6..64478828 100644 --- a/twindb_backup/source/exceptions.py +++ b/twindb_backup/source/exceptions.py @@ -1,6 +1,7 @@ """ Module for backup source exceptions. """ + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/source/mariadb_source.py b/twindb_backup/source/mariadb_source.py index ccb62330..ad1b90d9 100644 --- a/twindb_backup/source/mariadb_source.py +++ b/twindb_backup/source/mariadb_source.py @@ -1,6 +1,7 @@ """ Module defines MySQL source class for backing up local MariaDB server. """ + from twindb_backup import MARIABACKUP_BINARY from twindb_backup.source.mysql_source import MySQLSource diff --git a/twindb_backup/source/mysql_source.py b/twindb_backup/source/mysql_source.py index 3348a535..b39ba8e3 100644 --- a/twindb_backup/source/mysql_source.py +++ b/twindb_backup/source/mysql_source.py @@ -1,6 +1,7 @@ """ Module defines MySQL source class for backing up local MySQL. """ + from __future__ import print_function import os diff --git a/twindb_backup/source/remote_mariadb_source.py b/twindb_backup/source/remote_mariadb_source.py index 86e331eb..5ad91b71 100644 --- a/twindb_backup/source/remote_mariadb_source.py +++ b/twindb_backup/source/remote_mariadb_source.py @@ -1,6 +1,7 @@ """ Module defines MySQL source class for backing up local MariaDB server. """ + from twindb_backup import MARIABACKUP_BINARY from twindb_backup.source.remote_mysql_source import RemoteMySQLSource diff --git a/twindb_backup/ssh/client.py b/twindb_backup/ssh/client.py index 12a5397b..558a5975 100644 --- a/twindb_backup/ssh/client.py +++ b/twindb_backup/ssh/client.py @@ -1,6 +1,7 @@ """ Module that implements SSH client. """ + import socket from contextlib import contextmanager diff --git a/twindb_backup/ssh/exceptions.py b/twindb_backup/ssh/exceptions.py index a51eee54..510fb0fc 100644 --- a/twindb_backup/ssh/exceptions.py +++ b/twindb_backup/ssh/exceptions.py @@ -1,6 +1,7 @@ """ SSH Client Exceptions. """ + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/status/base_status.py b/twindb_backup/status/base_status.py index 5353e45d..eb0d4fe2 100644 --- a/twindb_backup/status/base_status.py +++ b/twindb_backup/status/base_status.py @@ -1,5 +1,6 @@ """Base status is a class for a general purpose status. """ + import hashlib import json import socket diff --git a/twindb_backup/status/binlog_status.py b/twindb_backup/status/binlog_status.py index 29e85157..68dbf81a 100644 --- a/twindb_backup/status/binlog_status.py +++ b/twindb_backup/status/binlog_status.py @@ -1,5 +1,6 @@ """Binlog status is a class for a binlog copies status. """ + import json from base64 import b64encode diff --git a/twindb_backup/status/exceptions.py b/twindb_backup/status/exceptions.py index 9a462813..d6154813 100644 --- a/twindb_backup/status/exceptions.py +++ b/twindb_backup/status/exceptions.py @@ -1,4 +1,5 @@ """Status exceptions.""" + from twindb_backup.exceptions import TwinDBBackupError diff --git a/twindb_backup/status/mysql_status.py b/twindb_backup/status/mysql_status.py index b92a291e..67d82aa2 100644 --- a/twindb_backup/status/mysql_status.py +++ b/twindb_backup/status/mysql_status.py @@ -1,4 +1,5 @@ """Class to store and work with status file""" + from __future__ import print_function import json diff --git a/twindb_backup/status/periodic_status.py b/twindb_backup/status/periodic_status.py index ed7dfb33..0da65159 100644 --- a/twindb_backup/status/periodic_status.py +++ b/twindb_backup/status/periodic_status.py @@ -1,6 +1,7 @@ """Periodic status is a class for a periodic copies status. For now status is created/maintained for MySQL copies only. """ + from twindb_backup import INTERVALS from twindb_backup.status.base_status import BaseStatus