diff --git a/.gitignore b/.gitignore index e5b39124..094f3a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build/ .ropeproject/ .vscode/ +dist/ diff --git a/.pylintrc b/.pylintrc index c58542c9..2e0f7842 100644 --- a/.pylintrc +++ b/.pylintrc @@ -144,14 +144,6 @@ confidence=HIGH, # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". disable=raw-checker-failed, - bad-inline-option, - locally-disabled, - file-ignored, - suppressed-message, - useless-suppression, - deprecated-pragma, - use-symbolic-message-instead, - useless-object-inheritance, consider-using-dict-items, broad-except, consider-using-with, diff --git a/INSTALL.md b/INSTALL.md index 44a9a379..d24eb1d3 100755 --- a/INSTALL.md +++ b/INSTALL.md @@ -68,7 +68,7 @@ Please see their documentation for details on how to install and use these conta ### Install base ** Requires Python Setuptool ``` -# python setup.py install +# python3 -m pip install . ``` ### Create documentation @@ -81,20 +81,20 @@ Please see their documentation for details on how to install and use these conta ### Install common plugins ``` # cd ${TARGET}/holland/plugins/holland.lib.common/ -# python setup.py install +# python3 -m pip install . ``` ### Most plugins require the holland.lib.mysql plugin ** The MySQldb connector requires gcc, mysql-devel, and python-devel ``` # cd ${TARGET}/holland/plugins/holland.lib.mysql/ -# python setup.py install +# python3 -m pip install . ``` ### Install other plugins ``` # cd ../holland.backup.{plugin name} -# python setup.py install +# python3 -m pip install . ``` ### Setup configuration files diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..5c7f4d2a --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +default: pylint +.PHONY: pylint_base pylint_plugins pylint +PROJDIR := $(realpath $(CURDIR)) +PLUGINS = ${shell find $(PROJDIR)/plugins/ -maxdepth 1 -name "holland.*" -print} + + +pylint_base: + pylint holland || exit 1 + +pylint_plugins: + for dir in $(PLUGINS) ; do echo $$dir; pylint $$dir/holland || exit 1; done + +pylint: pylint_base pylint_plugins + diff --git a/holland/commands/backup.py b/holland/commands/backup.py index 0ad48287..ff79b2a4 100644 --- a/holland/commands/backup.py +++ b/holland/commands/backup.py @@ -169,7 +169,7 @@ def call_hooks(event, entry): return 0 -class PurgeManager(object): +class PurgeManager: """ Find and clean up old backups """ diff --git a/holland/core/backup/base.py b/holland/core/backup/base.py index 7b54b7d0..6e5d8b1c 100644 --- a/holland/core/backup/base.py +++ b/holland/core/backup/base.py @@ -22,7 +22,7 @@ class BackupError(Exception): """Error during a backup""" -class BackupPlugin(object): +class BackupPlugin: """ Define a backup plugin """ @@ -81,7 +81,7 @@ def load_plugin(name, config, path, dry_run): ) -class BackupRunner(object): +class BackupRunner: """ Run backup """ diff --git a/holland/core/command/command.py b/holland/core/command/command.py index 0e6f2a3d..6da33a14 100644 --- a/holland/core/command/command.py +++ b/holland/core/command/command.py @@ -12,7 +12,7 @@ LOG = logging.getLogger(__name__) HOLLAND_VERSION = get_distribution("holland").version HOLLAND_BANNER = f""" -Holland Backup v%s +Holland Backup v{HOLLAND_VERSION} Copyright (c) 2008-2018 Rackspace US, Inc. More info available at http://hollandbackup.org @@ -21,7 +21,6 @@ [[[[[[[]]]]]]] [[[[[[[]]]]]]] [[[[[[[]]]]]]] [[[[[[[]]]]]]] -{HOLLAND_VERSION} """ HOLLAND_CONF = "/etc/holland/holland.conf" @@ -63,7 +62,7 @@ SUBPARSER = PARSER.add_subparsers(dest="command") -class Command(object): +class Command: """Base Command class for implementing pluggable commmands. diff --git a/holland/core/spool.py b/holland/core/spool.py index 097d63d8..cc2051dd 100644 --- a/holland/core/spool.py +++ b/holland/core/spool.py @@ -27,7 +27,7 @@ def timestamp_dir(when=None): return time.strftime("%Y%m%d_%H%M%S", time.localtime(when)) -class Spool(object): +class Spool: """ A directory spool where backups are saved """ @@ -132,7 +132,7 @@ def __iter__(self): return iter(self.list_backupsets()) -class Backupset(object): +class Backupset: """ Define backupset """ @@ -276,7 +276,7 @@ def _cmp(value1, value2): """.splitlines() -class Backup(object): +class Backup: """ Representation of a backup instance. """ diff --git a/holland/core/util/lock.py b/holland/core/util/lock.py index c78e78b2..3387f85b 100644 --- a/holland/core/util/lock.py +++ b/holland/core/util/lock.py @@ -12,7 +12,7 @@ def __init__(self, message, exc=None): self.exc = exc -class Lock(object): +class Lock: """A simple flock based file lock implementation""" def __init__(self, path): diff --git a/plugins/holland.backup.example/holland/backup/example.py b/plugins/holland.backup.example/holland/backup/example.py index c6c1edab..3c38d30f 100644 --- a/plugins/holland.backup.example/holland/backup/example.py +++ b/plugins/holland.backup.example/holland/backup/example.py @@ -13,7 +13,7 @@ """.splitlines() -class ExamplePlugin(object): +class ExamplePlugin: """An example backup plugin for holland""" def __init__(self, name, config, target_directory, dry_run=False): diff --git a/plugins/holland.backup.mariabackup/holland/backup/mariabackup/plugin.py b/plugins/holland.backup.mariabackup/holland/backup/mariabackup/plugin.py index 50a4d057..e2b41f81 100644 --- a/plugins/holland.backup.mariabackup/holland/backup/mariabackup/plugin.py +++ b/plugins/holland.backup.mariabackup/holland/backup/mariabackup/plugin.py @@ -41,7 +41,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class MariabackupPlugin(object): +class MariabackupPlugin: """control connection to mysql server""" mysql = None diff --git a/plugins/holland.backup.mongodump/holland/backup/mongodump.py b/plugins/holland.backup.mongodump/holland/backup/mongodump.py index ab1c02b4..dad73a77 100644 --- a/plugins/holland.backup.mongodump/holland/backup/mongodump.py +++ b/plugins/holland.backup.mongodump/holland/backup/mongodump.py @@ -33,7 +33,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class MongoDump(object): +class MongoDump: "MongoDB backup plugin for holland" def __init__(self, name, config, target_directory, dry_run=False): diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/dir.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/dir.py index 8e02b8e6..6f6893aa 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/dir.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/dir.py @@ -9,7 +9,7 @@ LOG = logging.getLogger(__name__) -class DirArchiveAction(object): +class DirArchiveAction: """Copy datadir""" def __init__(self, snap_datadir, backup_datadir, config): diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/_mysqld.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/_mysqld.py index 9dc81490..28f39ddb 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/_mysqld.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/_mysqld.py @@ -24,7 +24,7 @@ def locate_mysqld_exe(config): raise BackupError("Failed to find mysqld binary") -class MySQLServer(object): +class MySQLServer: """Manage New MySQL Server""" def __init__(self, mysqld_exe, defaults_file): diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/innodb.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/innodb.py index 0b0e93fd..6560cbb0 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/innodb.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/innodb.py @@ -12,7 +12,7 @@ LOG = logging.getLogger(__name__) -class InnodbRecoveryAction(object): +class InnodbRecoveryAction: """Perform InnoDB recovery against a MySQL data directory """ def __init__(self, mysqld_config): diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/lock.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/lock.py index 505c36f2..d0c6bae1 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/lock.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/lock.py @@ -5,7 +5,7 @@ LOG = logging.getLogger(__name__) -class FlushAndLockMySQLAction(object): +class FlushAndLockMySQLAction: """Lock Database""" def __init__(self, client, extra_flush=True): diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/mysqldump.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/mysqldump.py index 1d64bda5..347763cc 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/mysqldump.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/mysqldump.py @@ -13,7 +13,7 @@ LOG = logging.getLogger(__name__) -class MySQLDumpDispatchAction(object): +class MySQLDumpDispatchAction: """Setup environment for mysqldump""" def __init__(self, mysqldump_plugin, mysqld_config): diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/replication.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/replication.py index 0e2f2232..ef1417f4 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/replication.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/mysql/replication.py @@ -8,7 +8,7 @@ LOG = logging.getLogger(__name__) -class RecordMySQLReplicationAction(object): +class RecordMySQLReplicationAction: """Connect to MySQL""" def __init__(self, client, config): diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/tar.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/tar.py index b29d8176..aaec8e9f 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/tar.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/actions/tar.py @@ -12,7 +12,7 @@ LOG = logging.getLogger(__name__) -class TarArchiveAction(object): +class TarArchiveAction: """Create tar file""" def __init__(self, snap_datadir, archive_stream, config): diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/plugin/mysqldump/plugin.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/plugin/mysqldump/plugin.py index 55cf7171..35351a44 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/plugin/mysqldump/plugin.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/plugin/mysqldump/plugin.py @@ -58,7 +58,7 @@ ) -class MysqlDumpLVMBackup(object): +class MysqlDumpLVMBackup: """A Holland Backup plugin suitable for performing LVM snapshots of a filesystem underlying a live MySQL instance. diff --git a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/plugin/raw/plugin.py b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/plugin/raw/plugin.py index 563baa0b..15ae4536 100644 --- a/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/plugin/raw/plugin.py +++ b/plugins/holland.backup.mysql_lvm/holland/backup/mysql_lvm/plugin/raw/plugin.py @@ -70,7 +70,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class MysqlLVMBackup(object): +class MysqlLVMBackup: """ A Holland Backup plugin suitable for performing LVM snapshots of a filesystem underlying a live MySQL instance. diff --git a/plugins/holland.backup.mysqldump/holland/backup/mysqldump/command.py b/plugins/holland.backup.mysqldump/holland/backup/mysqldump/command.py index 5117ce82..06da7412 100644 --- a/plugins/holland.backup.mysqldump/holland/backup/mysqldump/command.py +++ b/plugins/holland.backup.mysqldump/holland/backup/mysqldump/command.py @@ -34,7 +34,7 @@ class MyOptionError(Exception): """Exception class for MySQL Option validation""" -class MyOptionChecker(object): +class MyOptionChecker: """Container for adding and validating multiple options""" OPTION_ARG_CRE = re.compile(r"^(--[^=]+)(?:=(.+))?$", re.UNICODE) @@ -62,7 +62,7 @@ def add_option(self, my_option): self._options[my_option.option] = my_option -class MyOption(object): +class MyOption: """General MySQL command option""" def __init__(self, option, min_version=None, arg=None): @@ -171,7 +171,7 @@ def mysqldump_version(command): raise MySQLDumpError("Failed to determine mysqldump version for %s" % command) -class MySQLDump(object): +class MySQLDump: """mysqldump command runner""" def __init__(self, defaults_file, cmd_path="mysqldump", extra_defaults=False, mock_env=None): diff --git a/plugins/holland.backup.mysqldump/holland/backup/mysqldump/mock/__init__.py b/plugins/holland.backup.mysqldump/holland/backup/mysqldump/mock/__init__.py index 3fbba479..c9b2fb14 100644 --- a/plugins/holland.backup.mysqldump/holland/backup/mysqldump/mock/__init__.py +++ b/plugins/holland.backup.mysqldump/holland/backup/mysqldump/mock/__init__.py @@ -4,14 +4,14 @@ # For 2.7 or newer use unittest.mock try: - from unittest.mock import MagicMock, ANY + from unittest.mock import ANY, MagicMock except ImportError: - from mock import MagicMock, ANY + from mock import ANY, MagicMock __all__ = ["MockEnvironment"] -class MockPopen(object): +class MockPopen: """ mock object to return to subclass.Popen """ @@ -39,7 +39,7 @@ def poll(): return 0 -class MockEnvironment(object): +class MockEnvironment: """ Setup environement for dry-run """ diff --git a/plugins/holland.backup.mysqldump/holland/backup/mysqldump/plugin.py b/plugins/holland.backup.mysqldump/holland/backup/mysqldump/plugin.py index 62faf732..00ce9cd1 100644 --- a/plugins/holland.backup.mysqldump/holland/backup/mysqldump/plugin.py +++ b/plugins/holland.backup.mysqldump/holland/backup/mysqldump/plugin.py @@ -77,7 +77,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class MySQLDumpPlugin(object): +class MySQLDumpPlugin: """MySQLDump Backup Plugin interface for Holland""" CONFIGSPEC = CONFIGSPEC diff --git a/plugins/holland.backup.pg_basebackup/holland/backup/pg_basebackup/interface.py b/plugins/holland.backup.pg_basebackup/holland/backup/pg_basebackup/interface.py index 06c6c3fb..baf09c38 100644 --- a/plugins/holland.backup.pg_basebackup/holland/backup/pg_basebackup/interface.py +++ b/plugins/holland.backup.pg_basebackup/holland/backup/pg_basebackup/interface.py @@ -50,7 +50,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class PgBaseBackup(object): +class PgBaseBackup: """ Postgres pg_basebackup backups """ diff --git a/plugins/holland.backup.pgdump/holland/backup/pgdump/interface.py b/plugins/holland.backup.pgdump/holland/backup/pgdump/interface.py index aacb76fc..178ad98e 100644 --- a/plugins/holland.backup.pgdump/holland/backup/pgdump/interface.py +++ b/plugins/holland.backup.pgdump/holland/backup/pgdump/interface.py @@ -49,7 +49,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class PgDump(object): +class PgDump: """ Postgres pg_dump backups """ diff --git a/plugins/holland.backup.random/holland/backup/random.py b/plugins/holland.backup.random/holland/backup/random.py index d15f3121..7e77b486 100644 --- a/plugins/holland.backup.random/holland/backup/random.py +++ b/plugins/holland.backup.random/holland/backup/random.py @@ -13,7 +13,7 @@ """.splitlines() -class RandomPlugin(object): +class RandomPlugin: """Back up randomness""" def __init__(self, name, config, target_directory, dry_run=False): diff --git a/plugins/holland.backup.sqlite/holland/backup/sqlite.py b/plugins/holland.backup.sqlite/holland/backup/sqlite.py index 8316ecb2..a5a6c091 100644 --- a/plugins/holland.backup.sqlite/holland/backup/sqlite.py +++ b/plugins/holland.backup.sqlite/holland/backup/sqlite.py @@ -21,7 +21,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class SQLitePlugin(object): +class SQLitePlugin: """Define Plugin to backup SQLite""" def __init__(self, name, config, target_directory, dry_run=False): diff --git a/plugins/holland.backup.tar/holland/backup/tar.py b/plugins/holland.backup.tar/holland/backup/tar.py index 37ff0d9e..ed81dd16 100644 --- a/plugins/holland.backup.tar/holland/backup/tar.py +++ b/plugins/holland.backup.tar/holland/backup/tar.py @@ -25,7 +25,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class TarPlugin(object): +class TarPlugin: """ Define Tar Backup method """ diff --git a/plugins/holland.backup.xtrabackup/holland/backup/xtrabackup/plugin.py b/plugins/holland.backup.xtrabackup/holland/backup/xtrabackup/plugin.py index 3dc677e6..85e12e51 100644 --- a/plugins/holland.backup.xtrabackup/holland/backup/xtrabackup/plugin.py +++ b/plugins/holland.backup.xtrabackup/holland/backup/xtrabackup/plugin.py @@ -43,7 +43,7 @@ CONFIGSPEC = CONFIGSPEC.splitlines() -class XtrabackupPlugin(object): +class XtrabackupPlugin: """plugin for backuping database using xtrabackup""" #: control connection to mysql server diff --git a/plugins/holland.lib.common/holland/lib/archive/dir_archive.py b/plugins/holland.lib.common/holland/lib/archive/dir_archive.py index a1a2593b..d56d7235 100644 --- a/plugins/holland.lib.common/holland/lib/archive/dir_archive.py +++ b/plugins/holland.lib.common/holland/lib/archive/dir_archive.py @@ -9,7 +9,7 @@ LOG = logging.getLogger(__name__) -class DirArchive(object): +class DirArchive: """ Read, write, access directory archives. Treats a directory like an archive. diff --git a/plugins/holland.lib.common/holland/lib/archive/tar_archive.py b/plugins/holland.lib.common/holland/lib/archive/tar_archive.py index e80e72a6..2b3bb018 100644 --- a/plugins/holland.lib.common/holland/lib/archive/tar_archive.py +++ b/plugins/holland.lib.common/holland/lib/archive/tar_archive.py @@ -27,7 +27,7 @@ def _make_tarinfo(name, size): return tarinfo -class TarArchive(object): +class TarArchive: """ Read, write, access Tar archives. """ diff --git a/plugins/holland.lib.common/holland/lib/archive/zip_archive.py b/plugins/holland.lib.common/holland/lib/archive/zip_archive.py index c18e3078..730fcbb3 100644 --- a/plugins/holland.lib.common/holland/lib/archive/zip_archive.py +++ b/plugins/holland.lib.common/holland/lib/archive/zip_archive.py @@ -9,7 +9,7 @@ LOG = logging.getLogger(__name__) -class ZipArchive(object): +class ZipArchive: """ Read, write, access Zip archives using zipfile. """ diff --git a/plugins/holland.lib.common/holland/lib/compression.py b/plugins/holland.lib.common/holland/lib/compression.py index b371668e..8cb4456f 100644 --- a/plugins/holland.lib.common/holland/lib/compression.py +++ b/plugins/holland.lib.common/holland/lib/compression.py @@ -57,7 +57,7 @@ def lookup_compression(method): raise OSError("Unsupported compression method '%s'" % method) -class CompressionInput(object): +class CompressionInput: """ Class to create a compressed file descriptor for reading. Functions like a standard file descriptor such as from open(). @@ -112,7 +112,7 @@ def close(self): self.closed = True -class CompressionOutput(object): +class CompressionOutput: """ Class to create a compressed file descriptor for writing. Functions like a standard file descriptor such as from open(). diff --git a/plugins/holland.lib.lvm/holland/lib/lvm/base.py b/plugins/holland.lib.lvm/holland/lib/lvm/base.py index 2cf394f0..e6dd369b 100644 --- a/plugins/holland.lib.lvm/holland/lib/lvm/base.py +++ b/plugins/holland.lib.lvm/holland/lib/lvm/base.py @@ -19,7 +19,7 @@ LOG = logging.getLogger(__name__) -class Volume(object): +class Volume: """Abstract Volume object for LVM Volume implementations This class should not directly be instantiated, but rather one diff --git a/plugins/holland.lib.lvm/holland/lib/lvm/snapshot.py b/plugins/holland.lib.lvm/holland/lib/lvm/snapshot.py index eafdd525..b87f3a93 100644 --- a/plugins/holland.lib.lvm/holland/lib/lvm/snapshot.py +++ b/plugins/holland.lib.lvm/holland/lib/lvm/snapshot.py @@ -12,7 +12,7 @@ __all__ = ["Snapshot", "CallbackFailuresError"] -class Snapshot(object): +class Snapshot: """Snapshot state machine""" def __init__(self, name, size, mountpoint): diff --git a/plugins/holland.lib.lvm/holland/lib/lvm/util.py b/plugins/holland.lib.lvm/holland/lib/lvm/util.py index 07955b5b..68c61eb7 100644 --- a/plugins/holland.lib.lvm/holland/lib/lvm/util.py +++ b/plugins/holland.lib.lvm/holland/lib/lvm/util.py @@ -121,7 +121,7 @@ def parse_bytes(units_string): return int(float(number) * 1024 ** (exponent)) -class SignalManager(object): +class SignalManager: """Manage signals around critical sections""" def __init__(self): diff --git a/plugins/holland.lib.mysql/holland/lib/mysql/cli.py b/plugins/holland.lib.mysql/holland/lib/mysql/cli.py index 3c3ad54d..98761941 100644 --- a/plugins/holland.lib.mysql/holland/lib/mysql/cli.py +++ b/plugins/holland.lib.mysql/holland/lib/mysql/cli.py @@ -23,7 +23,7 @@ from subprocess import getstatusoutput -class CmdOption(object): +class CmdOption: """ Create CmdOption class """ diff --git a/plugins/holland.lib.mysql/holland/lib/mysql/client/base.py b/plugins/holland.lib.mysql/holland/lib/mysql/client/base.py index 5cb75a15..d3267284 100644 --- a/plugins/holland.lib.mysql/holland/lib/mysql/client/base.py +++ b/plugins/holland.lib.mysql/holland/lib/mysql/client/base.py @@ -50,7 +50,7 @@ def flatten_list(a_list): ) -class MySQLClient(object): +class MySQLClient: """pymysql Helper Provides common functions for reading meta-data diff --git a/plugins/holland.lib.mysql/holland/lib/mysql/find.py b/plugins/holland.lib.mysql/holland/lib/mysql/find.py index 47075cea..b9167598 100644 --- a/plugins/holland.lib.mysql/holland/lib/mysql/find.py +++ b/plugins/holland.lib.mysql/holland/lib/mysql/find.py @@ -8,7 +8,7 @@ LOG = logging.getLogger(__name__) -class MySQLFind(object): +class MySQLFind: """ Create list of included and excluded tables """ diff --git a/plugins/holland.lib.mysql/holland/lib/mysql/schema/base.py b/plugins/holland.lib.mysql/holland/lib/mysql/schema/base.py index 003a0736..a47d4a45 100644 --- a/plugins/holland.lib.mysql/holland/lib/mysql/schema/base.py +++ b/plugins/holland.lib.mysql/holland/lib/mysql/schema/base.py @@ -14,7 +14,7 @@ TRANSACTIONAL_ENGINES = "innodb", "federated", "myisam_mrg", "memory", "view", "blackhole" -class MySQLSchema(object): +class MySQLSchema: """A catalog summary of a MySQL Instance""" def __init__(self): @@ -168,7 +168,7 @@ def refresh(self, db_iter, tbl_iter, fast_iterate=False): self.timestamp = time.time() -class Database(object): +class Database: """Representation of a MySQL Database Only the name an whether this database is @@ -231,7 +231,7 @@ def __str__(self): __repr__ = __str__ -class Table(object): +class Table: """Representation of a MySQL Table""" __slots__ = ("database", "name", "data_size", "index_size", "engine", "excluded") @@ -271,7 +271,7 @@ def __str__(self): ) -class DatabaseIterator(object): +class DatabaseIterator: """Iterate over databases returns by a MySQLClient instance client must have a show_databases() method @@ -294,7 +294,7 @@ def __call__(self): yield Database(name) -class TableIterator(object): +class TableIterator: """Iterate over tables returned by the client instance client must have a show_table_metadata(database_name) method diff --git a/plugins/holland.lib.mysql/holland/lib/mysql/schema/filter.py b/plugins/holland.lib.mysql/holland/lib/mysql/schema/filter.py index 0168393b..1065b1a5 100644 --- a/plugins/holland.lib.mysql/holland/lib/mysql/schema/filter.py +++ b/plugins/holland.lib.mysql/holland/lib/mysql/schema/filter.py @@ -4,7 +4,7 @@ import re -class BaseFilter(object): +class BaseFilter: """Filter a string based on a list of regular expression or glob patterns. This should be inherited and the __call__ overriden with a real diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..fa5bf056 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[project] +name = "holland" +version = "1.2.11" +description = "Holland Core Plugins" +entry_points=""" + # Scripts generated by setuptools + [console_scripts] + holland = holland.core.cmdshell:main + + # Holland subcommands + [holland.commands] + #help = holland.commands.help:Help + listplugins = holland.commands.list_plugins:ListPlugins + listbackups = holland.commands.list_backups:ListBackups + backup = holland.commands.backup:Backup + mk-config = holland.commands.mk_config:MkConfig + purge = holland.commands.purge:Purge + #restore = holland.commands.restore:Restore + """ +author="Rackspace" +url="http://www.hollandbackup.org/" +license="3-Clause BSD" + +[build-system] +requires = ["configobj>=4.6.0","setuptools", "wheel"] +build-backend = "setuptools.build_meta" +