@@ -126,7 +126,7 @@ def __repr__(self):
126126
127127
128128class PostgresNode (object ):
129- def __init__ (self , name = None , port = None , base_dir = None , conn_params : ConnectionParams = ConnectionParams (), bin_dir = None , prefix = None ):
129+ def __init__ (self , name = None , base_dir = None , port = None , conn_params : ConnectionParams = ConnectionParams (), bin_dir = None , prefix = None ):
130130 """
131131 PostgresNode constructor.
132132
@@ -527,7 +527,9 @@ def get_auth_method(t):
527527 u"host\t replication\t all\t 127.0.0.1/32\t {}\n " .format (auth_host ),
528528 u"host\t replication\t all\t ::1/128\t \t {}\n " .format (auth_host ),
529529 u"host\t replication\t all\t {}/24\t \t {}\n " .format (subnet_base , auth_host ),
530- u"host\t all\t all\t {}/24\t \t {}\n " .format (subnet_base , auth_host )
530+ u"host\t all\t all\t {}/24\t \t {}\n " .format (subnet_base , auth_host ),
531+ u"host\t all\t all\t all\t {}\n " .format (auth_host ),
532+ u"host\t replication\t all\t all\t {}\n " .format (auth_host )
531533 ] # yapf: disable
532534
533535 # write missing lines
@@ -1670,37 +1672,45 @@ def _get_bin_path(self, filename):
16701672
16711673class NodeApp :
16721674
1673- def __init__ (self , test_path , nodes_to_cleanup , os_ops = LocalOperations ()):
1674- self .test_path = test_path
1675- self .nodes_to_cleanup = nodes_to_cleanup
1675+ def __init__ (self , test_path = None , nodes_to_cleanup = None , os_ops = LocalOperations ()):
1676+ print ('ALEXEY in nodeapp init' , test_path )
1677+ if test_path :
1678+ if os .path .isabs (test_path ):
1679+ self .test_path = test_path
1680+ else :
1681+ self .test_path = os .path .join (os_ops .cwd (), test_path )
1682+ else :
1683+ self .test_path = os_ops .cwd ()
1684+ print ('ALEXEY in nodeapp resulting test path' , self .test_path )
1685+ self .nodes_to_cleanup = nodes_to_cleanup if nodes_to_cleanup else []
16761686 self .os_ops = os_ops
16771687
16781688 def make_empty (
16791689 self ,
1680- port = None ,
1681- base_dir = None ):
1690+ base_dir = None ,
1691+ port = None ):
16821692 real_base_dir = os .path .join (self .test_path , base_dir )
16831693 self .os_ops .rmdirs (real_base_dir , ignore_errors = True )
16841694 self .os_ops .makedirs (real_base_dir )
16851695
1686- node = PostgresNode (port = port , base_dir = real_base_dir )
1696+ node = PostgresNode (base_dir = real_base_dir , port = port )
16871697 node .should_rm_dirs = True
16881698 self .nodes_to_cleanup .append (node )
16891699
16901700 return node
16911701
16921702 def make_simple (
16931703 self ,
1694- port = None ,
16951704 base_dir = None ,
1705+ port = None ,
16961706 set_replication = False ,
16971707 ptrack_enable = False ,
16981708 initdb_params = [],
16991709 pg_options = {},
17001710 checksum = True ):
17011711 if checksum and '--data-checksums' not in initdb_params :
17021712 initdb_params .append ('--data-checksums' )
1703- node = self .make_empty (base_dir )
1713+ node = self .make_empty (base_dir , port )
17041714 node .init (
17051715 initdb_params = initdb_params , allow_streaming = set_replication )
17061716
0 commit comments