testgres-pg-probackup2 0.3.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/PKG-INFO +1 -1
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/pg_probackup2/app.py +22 -6
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/setup.py +1 -1
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/testgres_pg_probackup2.egg-info/PKG-INFO +1 -1
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/README.md +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/pg_probackup2/__init__.py +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/pg_probackup2/gdb.py +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/pg_probackup2/init_helpers.py +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/pg_probackup2/storage/__init__.py +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/pg_probackup2/storage/fs_backup.py +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/setup.cfg +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/testgres_pg_probackup2.egg-info/SOURCES.txt +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/testgres_pg_probackup2.egg-info/dependency_links.txt +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/testgres_pg_probackup2.egg-info/requires.txt +0 -0
- {testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/testgres_pg_probackup2.egg-info/top_level.txt +0 -0
|
@@ -41,15 +41,24 @@ class ProbackupException(Exception):
|
|
|
41
41
|
fs_backup_class = FSTestBackupDir
|
|
42
42
|
|
|
43
43
|
|
|
44
|
+
class _OutputContainer:
|
|
45
|
+
"""Internal container for output and cmd when test_class is not provided"""
|
|
46
|
+
def __init__(self):
|
|
47
|
+
self.output = None
|
|
48
|
+
self.cmd = None
|
|
49
|
+
|
|
50
|
+
|
|
44
51
|
class ProbackupApp:
|
|
45
52
|
|
|
46
|
-
def __init__(self, test_class: unittest.TestCase,
|
|
47
|
-
pg_node, pb_log_path, test_env, auto_compress_alg
|
|
53
|
+
def __init__(self, test_class: unittest.TestCase = None,
|
|
54
|
+
pg_node=None, pb_log_path=None, test_env=None, auto_compress_alg=None,
|
|
55
|
+
backup_dir=None, probackup_path=None):
|
|
48
56
|
self.process = None
|
|
49
|
-
|
|
57
|
+
# Use provided test_class or create internal container
|
|
58
|
+
self.test_class = test_class if test_class is not None else _OutputContainer()
|
|
50
59
|
self.pg_node = pg_node
|
|
51
60
|
self.pb_log_path = pb_log_path
|
|
52
|
-
self.test_env = test_env
|
|
61
|
+
self.test_env = test_env if test_env is not None else os.environ.copy()
|
|
53
62
|
self.auto_compress_alg = auto_compress_alg
|
|
54
63
|
self.backup_dir = backup_dir
|
|
55
64
|
self.probackup_path = probackup_path or init_params.probackup_path
|
|
@@ -571,7 +580,7 @@ class ProbackupApp:
|
|
|
571
580
|
backup_list.append(backup)
|
|
572
581
|
|
|
573
582
|
if backup_id is not None:
|
|
574
|
-
|
|
583
|
+
raise RuntimeError("Failed to find backup with ID: {0}".format(backup_id))
|
|
575
584
|
|
|
576
585
|
return backup_list
|
|
577
586
|
else:
|
|
@@ -629,7 +638,7 @@ class ProbackupApp:
|
|
|
629
638
|
specific_record[name.strip()] = var
|
|
630
639
|
|
|
631
640
|
if not specific_record:
|
|
632
|
-
|
|
641
|
+
raise RuntimeError("Failed to find backup with ID: {0}".format(backup_id))
|
|
633
642
|
|
|
634
643
|
return specific_record
|
|
635
644
|
|
|
@@ -778,6 +787,13 @@ class ProbackupApp:
|
|
|
778
787
|
log_level=False, archive_timeout=False,
|
|
779
788
|
custom_archive_command=None):
|
|
780
789
|
|
|
790
|
+
# check instance existing
|
|
791
|
+
instances_json = self.show(instance=None, as_json=True, expect_error=False, as_text=True)
|
|
792
|
+
instances_data = json.loads(instances_json)
|
|
793
|
+
if not any(inst_data.get('instance') == instance for inst_data in instances_data):
|
|
794
|
+
raise RuntimeError("Instance '{0}' does not exist. " \
|
|
795
|
+
"Please add the instance first using add_instance() or init_pb_node().".format(instance))
|
|
796
|
+
|
|
781
797
|
# parse postgresql.auto.conf
|
|
782
798
|
options = {}
|
|
783
799
|
if replica:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/pg_probackup2/storage/__init__.py
RENAMED
|
File without changes
|
{testgres_pg_probackup2-0.3.0 → testgres_pg_probackup2-0.5.0}/pg_probackup2/storage/fs_backup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|