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

Commita2d9113

Browse files
author
v.shepard
committed
PBCKP-152 test multihost - 2
1 parent9f97acb commita2d9113

File tree

6 files changed

+249
-230
lines changed

6 files changed

+249
-230
lines changed

‎testgres/backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self,
7474
data_dir=os.path.join(self.base_dir,DATA_DIR)
7575

7676
_params= [
77-
get_bin_path("pg_basebackup"),
77+
get_bin_path("pg_basebackup",node.host,node.ssh_key),
7878
"-p",str(node.port),
7979
"-h",node.host,
8080
"-U",username,

‎testgres/cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def call_initdb(initdb_dir, log=None):
6060
f.write(generate_system_id())# overwrite id
6161

6262
# XXX: build new WAL segment with our system id
63-
_params= [get_bin_path("pg_resetwal"),"-D",data_dir,"-f"]
63+
_params= [get_bin_path("pg_resetwal",host,ssh_key),"-D",data_dir,"-f"]
6464

6565

6666
# DDD refactor to PostgresNode method and check execute code
67-
execute_utility(_params,logfile,hostname=hostname)
67+
execute_utility(_params,logfile,host=host,ssh_key=ssh_key)
6868

6969
exceptExecUtilExceptionase:
7070
msg="Failed to reset WAL for system id"

‎testgres/connection.py

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
# coding: utf-8
2-
3-
# we support both pg8000 and psycopg2
4-
importpsycopg2aspglib
5-
6-
71
from .enumsimportIsolationLevel
2+
from .defaultsimportdefault_dbname
3+
from .exceptionsimportQueryException
84

9-
from .defaultsimport \
10-
default_dbname, \
11-
default_username
125

13-
from .exceptionsimportQueryException
6+
# we support both pg8000 and psycopg2
7+
importpsycopg2aspglib
148

159
# export some exceptions
1610
DatabaseError=pglib.DatabaseError
@@ -23,25 +17,14 @@ class NodeConnection(object):
2317
"""
2418
Transaction wrapper returned by Node
2519
"""
26-
def__init__(self,
27-
node,
28-
dbname=None,
29-
username=None,
30-
password=None,
31-
autocommit=False):
32-
20+
def__init__(self,node,dbname=None,username=None,password=None,autocommit=False):
3321
# Set default arguments
3422
dbname=dbnameordefault_dbname()
35-
username=usernameordefault_username()
23+
username=usernameor'dev'
3624

3725
self._node=node
38-
39-
self._connection=pglib.connect(database=dbname,
40-
user=username,
41-
password=password,
42-
host=node.host,
43-
port=node.port)
44-
26+
self._connection=pglib.connect(database=dbname,user=username,password=password,
27+
host=node.host,port=node.port)
4528
self._connection.autocommit=autocommit
4629
self._cursor=self.connection.cursor()
4730

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp