Skip to content

Adding port and database name into params list for add-instance command #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions testgres/plugins/pg_probackup2/pg_probackup2/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,19 @@ def init(self, options=None, old_binary=False, skip_log_directory=False, expect_
use_backup_dir=use_backup_dir
)

def add_instance(self, instance, node, old_binary=False, options=None, expect_error=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use datname=None as unset value

def add_instance(self, instance, node, old_binary=False, options=None, expect_error=False, datname=False):
if options is None:
options = []

if not datname:
datname = 'postgres'

cmd = [
'add-instance',
'--instance={0}'.format(instance),
'-D', node.data_dir
'-D', node.data_dir,
'--pgport', '%i' % node.port,
'--pgdatabase', datname
]

# don`t forget to kill old_binary after remote ssh release
Expand Down