1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-02-03 14:01:57 +02:00

fix archive.py

This commit is contained in:
s.logvinenko 2017-11-08 18:06:50 +03:00
parent 2d3c3dbe22
commit 5402d433fc

View File

@ -133,10 +133,7 @@ class ProbackupTest(object):
if self.test_env['PGPRO_PARANOIA_MODE'] == 'ON': if self.test_env['PGPRO_PARANOIA_MODE'] == 'ON':
self.paranoia = True self.paranoia = True
try: testgres.configure_testgres(cache_initdb=False, cache_pg_config=False, node_cleanup_full=False)
testgres.configure_testgres(cache_initdb=False, cache_pg_config=False, node_cleanup_full=False)
except:
pass
self.helpers_path = os.path.dirname(os.path.realpath(__file__)) self.helpers_path = os.path.dirname(os.path.realpath(__file__))
self.dir_path = os.path.abspath(os.path.join(self.helpers_path, os.pardir)) self.dir_path = os.path.abspath(os.path.join(self.helpers_path, os.pardir))
@ -192,14 +189,6 @@ class ProbackupTest(object):
for key, value in six.iteritems(pg_options): for key, value in six.iteritems(pg_options):
node.append_conf("postgresql.auto.conf", "%s = %s" % (key, value)) node.append_conf("postgresql.auto.conf", "%s = %s" % (key, value))
# Allow replication in pg_hba.conf
if set_replication:
try:
node.set_replication_conf()
node.append_conf("postgresql.auto.conf", "max_wal_senders = 10")
except:
pass
return node return node
def create_tblspace_in_node(self, node, tblspc_name, cfs=False): def create_tblspace_in_node(self, node, tblspc_name, cfs=False):
@ -644,11 +633,7 @@ class ProbackupTest(object):
@staticmethod @staticmethod
def switch_wal_segment(node): def switch_wal_segment(node):
min_ver = LooseVersion('10.0') min_ver = LooseVersion('10.0')
cur_ver = LooseVersion(testgres.get_pg_version())
try:
cur_ver = LooseVersion(testgres.get_pg_version())
except Exception as e:
cur_ver = LooseVersion(node.safe_psql("postgres", "show server_version"))
if cur_ver >= min_ver: if cur_ver >= min_ver:
node.safe_psql("postgres", "select pg_switch_wal()") node.safe_psql("postgres", "select pg_switch_wal()")