Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd2d85d

Browse files
committed
tests: added truncate_every_file_in_dir
1 parente66d96a commitdd2d85d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎tests/helpers/ptrack_helpers.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,12 @@ def get_backup_filelist_diff(self, filelist_A, filelist_B):
584584

585585
returnfilelist_diff
586586

587+
# used for partial restore
588+
deftruncate_every_file_in_dir(self,path):
589+
forfileinos.listdir(path):
590+
withopen(os.path.join(path,file),"w")asf:
591+
f.close()
592+
587593
defcheck_ptrack_recovery(self,idx_dict):
588594
size=idx_dict['size']
589595
forPageNuminrange(size):
@@ -734,20 +740,24 @@ def clean_pb(self, backup_dir):
734740

735741
defbackup_node(
736742
self,backup_dir,instance,node,data_dir=False,
737-
backup_type='full',options=[],asynchronous=False,gdb=False,
743+
backup_type='full',datname=False,options=[],
744+
asynchronous=False,gdb=False,
738745
old_binary=False,return_id=True
739746
):
740747
ifnotnodeandnotdata_dir:
741748
print('You must provide ether node or data_dir for backup')
742749
exit(1)
743750

751+
ifnotdatname:
752+
datname='postgres'
753+
744754
cmd_list= [
745755
'backup',
746756
'-B',backup_dir,
747757
'--instance={0}'.format(instance),
748758
# "-D", pgdata,
749759
'-p','%i'%node.port,
750-
'-d','postgres'
760+
'-d',datname
751761
]
752762

753763
ifdata_dir:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp