testgres-pg-probackup2 0.4.0__tar.gz → 0.6.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.
Files changed (15) hide show
  1. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/PKG-INFO +1 -1
  2. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/pg_probackup2/app.py +13 -11
  3. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/setup.py +1 -1
  4. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/testgres_pg_probackup2.egg-info/PKG-INFO +1 -1
  5. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/README.md +0 -0
  6. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/pg_probackup2/__init__.py +0 -0
  7. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/pg_probackup2/gdb.py +0 -0
  8. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/pg_probackup2/init_helpers.py +0 -0
  9. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/pg_probackup2/storage/__init__.py +0 -0
  10. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/pg_probackup2/storage/fs_backup.py +0 -0
  11. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/setup.cfg +0 -0
  12. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/testgres_pg_probackup2.egg-info/SOURCES.txt +0 -0
  13. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/testgres_pg_probackup2.egg-info/dependency_links.txt +0 -0
  14. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/testgres_pg_probackup2.egg-info/requires.txt +0 -0
  15. {testgres_pg_probackup2-0.4.0 → testgres_pg_probackup2-0.6.0}/testgres_pg_probackup2.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testgres_pg_probackup2
3
- Version: 0.4.0
3
+ Version: 0.6.0
4
4
  Summary: Plugin for testgres that manages pg_probackup2
5
5
  Home-page: https://github.com/postgrespro/testgres
6
6
  Author: Postgres Professional
@@ -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, backup_dir, probackup_path=None):
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
- self.test_class = test_class
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
@@ -778,13 +787,6 @@ class ProbackupApp:
778
787
  log_level=False, archive_timeout=False,
779
788
  custom_archive_command=None):
780
789
 
781
- # check instance existing
782
- instances_json = self.show(instance=None, as_json=True, expect_error=False, as_text=True)
783
- instances_data = json.loads(instances_json)
784
- if not any(inst_data.get('instance') == instance for inst_data in instances_data):
785
- raise RuntimeError("Instance '{0}' does not exist. " \
786
- "Please add the instance first using add_instance() or init_pb_node().".format(instance))
787
-
788
790
  # parse postgresql.auto.conf
789
791
  options = {}
790
792
  if replica:
@@ -4,7 +4,7 @@ except ImportError:
4
4
  from distutils.core import setup
5
5
 
6
6
  setup(
7
- version='0.4.0',
7
+ version='0.6.0',
8
8
  name='testgres_pg_probackup2',
9
9
  packages=['pg_probackup2', 'pg_probackup2.storage'],
10
10
  description='Plugin for testgres that manages pg_probackup2',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testgres_pg_probackup2
3
- Version: 0.4.0
3
+ Version: 0.6.0
4
4
  Summary: Plugin for testgres that manages pg_probackup2
5
5
  Home-page: https://github.com/postgrespro/testgres
6
6
  Author: Postgres Professional