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

Commit99036b9

Browse files
author
Viktoria
committed
Remove using paramiko
1 parent6cb3a80 commit99036b9

File tree

6 files changed

+94
-132
lines changed

6 files changed

+94
-132
lines changed

‎setup.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"six>=1.9.0",
1313
"psutil",
1414
"packaging",
15-
"paramiko",
1615
"fabric",
1716
"sshtunnel"
1817
]

‎testgres/cache.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def call_initdb(initdb_dir, log=logfile):
5757
# our initdb caching mechanism breaks this contract.
5858
pg_control=os.path.join(data_dir,XLOG_CONTROL_FILE)
5959
system_id=generate_system_id()
60-
os_ops.write(pg_control,system_id,truncate=True,binary=True,read_and_write=True)
60+
cur_pg_control=os_ops.read(pg_control,binary=True)
61+
new_pg_control=system_id+cur_pg_control[len(system_id):]
62+
os_ops.write(pg_control,new_pg_control,truncate=True,binary=True,read_and_write=True)
6163

6264
# XXX: build new WAL segment with our system id
6365
_params= [get_bin_path("pg_resetwal"),"-D",data_dir,"-f"]

‎testgres/operations/local_ops.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,13 @@ def touch(self, filename):
198198
withopen(filename,"a"):
199199
os.utime(filename,None)
200200

201-
defread(self,filename,encoding=None):
202-
withopen(filename,"r",encoding=encoding)asfile:
203-
returnfile.read()
201+
defread(self,filename,encoding=None,binary=False):
202+
mode="rb"ifbinaryelse"r"
203+
withopen(filename,mode)asfile:
204+
ifbinary:
205+
returnfile.read()
206+
returnfile.read().decode(encodingor'utf-8')
207+
204208

205209
defreadlines(self,filename,num_lines=0,binary=False,encoding=None):
206210
"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp