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

Commitad40c0f

Browse files
authored
Remove using paramiko (#89)
* Remove using paramiko* Up version 1.9.1
1 parent6cb3a80 commitad40c0f

File tree

9 files changed

+108
-137
lines changed

9 files changed

+108
-137
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ the configuration file, which means that they should be called before `append_co
176176
###Remote mode
177177
Testgres supports the creation of PostgreSQL nodes on a remote host. This is useful when you want to run distributed tests involving multiple nodes spread across different machines.
178178

179-
To use this feature, you need to use the RemoteOperations class.
179+
To use this feature, you need to use the RemoteOperations class. This feature is only supported with Linux.
180180
Here is an example of how you might set this up:
181181

182182
```python

‎setup.py

Lines changed: 1 addition & 2 deletions
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
]
@@ -30,7 +29,7 @@
3029
readme=f.read()
3130

3231
setup(
33-
version='1.9.0',
32+
version='1.9.1',
3433
name='testgres',
3534
packages=['testgres','testgres.operations'],
3635
description='Testing utility for PostgreSQL and its extensions',

‎testgres/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,16 @@
4646
First, \
4747
Any
4848

49+
from .configimporttestgres_config
50+
4951
from .operations.os_opsimportOsOperations,ConnectionParams
5052
from .operations.local_opsimportLocalOperations
5153
from .operations.remote_opsimportRemoteOperations
5254

5355
__all__= [
5456
"get_new_node",
5557
"get_remote_node",
56-
"NodeBackup",
58+
"NodeBackup","testgres_config",
5759
"TestgresConfig","configure_testgres","scoped_config","push_config","pop_config",
5860
"NodeConnection","DatabaseError","InternalError","ProgrammingError","OperationalError",
5961
"TestgresException","ExecUtilException","QueryException","TimeoutException","CatchUpException","StartNodeException","InitNodeException","BackupException",

‎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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,15 @@ 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+
content=file.read()
205+
ifbinary:
206+
returncontent
207+
ifisinstance(content,bytes):
208+
returncontent.decode(encodingor'utf-8')
209+
returncontent
204210

205211
defreadlines(self,filename,num_lines=0,binary=False,encoding=None):
206212
"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp