@@ -262,26 +262,6 @@ def init_from_backup(self, root_node, backup_name, has_streaming=False,
262262 if has_streaming :
263263 self .enable_streaming (root_node )
264264
265- def set_archiving_conf (self , archive_dir ):
266- self .append_conf (
267- "postgresql.auto.conf" ,
268- "wal_level = archive"
269- )
270- self .append_conf (
271- "postgresql.auto.conf" ,
272- "archive_mode = on"
273- )
274- if os .name == 'posix' :
275- self .append_conf (
276- "postgresql.auto.conf" ,
277- "archive_command = 'test ! -f {0}/%f && cp %p {0}/%f'" .format (archive_dir )
278- )
279- elif os .name == 'nt' :
280- self .append_conf (
281- "postgresql.auto.conf" ,
282- "archive_command = 'copy %p {0}\\ %f'" .format (archive_dir )
283- )
284-
285265 def set_replication_conf (self ):
286266 hba_conf = os .path .join (self .data_dir , "pg_hba.conf" )
287267 with open (hba_conf , "a" ) as conf :
@@ -382,6 +362,7 @@ def get_pid(self):
382362 return None
383363
384364 def get_control_data (self ):
365+ """ Return pg_control content """
385366 out_data = {}
386367 pg_controldata = self .get_bin_path ("pg_controldata" )
387368 try :
@@ -440,9 +421,6 @@ def cleanup(self):
440421 pass
441422
442423 # remove data directory
443- tblspace_list = os .listdir (os .path .join (self .data_dir , 'pg_tblspc' ))
444- for i in tblspace_list :
445- shutil .rmtree (os .readlink (os .path .join (self .data_dir , 'pg_tblspc' , i )))
446424 shutil .rmtree (self .data_dir )
447425
448426 return self
@@ -457,7 +435,7 @@ def psql(self, dbname, query=None, filename=None, username=None):
457435 """
458436 psql = self .get_bin_path ("psql" )
459437 psql_params = [
460- psql , "-XAtq" , "-h127.0.0.1" , "-p {}" .format (self .port ), dbname
438+ psql , "-XAtq" , "-h{}" . format ( self . host ) , "-p {}" .format (self .port ), dbname
461439 ]
462440
463441 if query :
0 commit comments