Skip to content

Commit fd11545

Browse files
author
Viktoriia Shepard
committed
Change setting user in start_node
1 parent 263ff9c commit fd11545

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

testgres/node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ def get_control_data(self):
659659

660660
return out_dict
661661

662-
def slow_start(self, replica=False, dbname='template1', username=default_username(), max_attempts=0):
662+
def slow_start(self, replica=False, dbname='template1', username=None, max_attempts=0):
663663
"""
664664
Starts the PostgreSQL instance and then polls the instance
665665
until it reaches the expected state (primary or replica). The state is checked
@@ -672,6 +672,8 @@ def slow_start(self, replica=False, dbname='template1', username=default_usernam
672672
If False, waits for the instance to be in primary mode. Default is False.
673673
max_attempts:
674674
"""
675+
if not username:
676+
username = default_username()
675677
self.start()
676678

677679
if replica:

testgres/operations/local_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def set_env(self, var_name, var_val):
117117

118118
# Get environment variables
119119
def get_user(self):
120-
return getpass.getuser()
120+
return self.username or getpass.getuser()
121121

122122
def get_name(self):
123123
return os.name

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy