refactor(drivers): organize backup modules into drivers subfolder
lint / docker (push) Has been cancelled
lint / docker (push) Has been cancelled
- Move all backup_*.py files to libtisbackup/drivers/ subdirectory - Move XenAPI.py and copy_vm_xcp.py to drivers/ (driver-specific) - Create drivers/__init__.py with automatic driver imports - Update tisbackup.py imports to use new structure - Add pyvmomi>=8.0.0 as mandatory dependency - Sync requirements.txt with pyproject.toml dependencies - Add pylint>=3.0.0 and pytest-cov>=6.0.0 to dev dependencies - Configure pylint and coverage tools in pyproject.toml - Add conventional commits guidelines to CLAUDE.md - Enhance .gitignore with comprehensive patterns for Python, IDEs, testing, and secrets - Update CLAUDE.md documentation with new structure and tooling Breaking Changes: - Drivers must now be imported from libtisbackup.drivers instead of libtisbackup - All backup driver files relocated to drivers/ subdirectory 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -15,3 +15,77 @@
|
||||
# along with TISBackup. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
"""
|
||||
TISBackup library - Backup orchestration and driver management.
|
||||
|
||||
This package provides a modular backup system with:
|
||||
- Base driver classes for implementing backup types
|
||||
- Database management for backup statistics
|
||||
- SSH and process execution utilities
|
||||
- Date/time and formatting helpers
|
||||
"""
|
||||
|
||||
# Import from new modular structure
|
||||
from .base_driver import (
|
||||
backup_drivers,
|
||||
backup_generic,
|
||||
nagiosStateCritical,
|
||||
nagiosStateOk,
|
||||
nagiosStateUnknown,
|
||||
nagiosStateWarning,
|
||||
register_driver,
|
||||
)
|
||||
from .database import BackupStat
|
||||
from .process import call_external_process, monitor_stdout
|
||||
from .ssh import load_ssh_private_key, ssh_exec
|
||||
from .utils import (
|
||||
check_string,
|
||||
convert_bytes,
|
||||
dateof,
|
||||
datetime2isodate,
|
||||
fileisodate,
|
||||
hours_minutes,
|
||||
html_table,
|
||||
isodate2datetime,
|
||||
pp,
|
||||
splitThousands,
|
||||
str2bool,
|
||||
time2display,
|
||||
)
|
||||
|
||||
# Maintain backward compatibility - re-export everything that was in common.py
|
||||
__all__ = [
|
||||
# Nagios states
|
||||
"nagiosStateOk",
|
||||
"nagiosStateWarning",
|
||||
"nagiosStateCritical",
|
||||
"nagiosStateUnknown",
|
||||
# Driver registry
|
||||
"backup_drivers",
|
||||
"register_driver",
|
||||
# Base classes
|
||||
"backup_generic",
|
||||
"BackupStat",
|
||||
# SSH utilities
|
||||
"load_ssh_private_key",
|
||||
"ssh_exec",
|
||||
# Process utilities
|
||||
"call_external_process",
|
||||
"monitor_stdout",
|
||||
# Date/time utilities
|
||||
"datetime2isodate",
|
||||
"isodate2datetime",
|
||||
"time2display",
|
||||
"hours_minutes",
|
||||
"fileisodate",
|
||||
"dateof",
|
||||
# Formatting utilities
|
||||
"splitThousands",
|
||||
"convert_bytes",
|
||||
"pp",
|
||||
"html_table",
|
||||
# Validation utilities
|
||||
"check_string",
|
||||
"str2bool",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user