8000 Abs backup path by demonolock · Pull Request #108 · postgrespro/testgres · GitHub
[go: up one dir, main page]

Skip to content

Abs backup path #108

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 6 commits into from
Feb 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rewrite the conditional processing of backup_prefix
  • Loading branch information
asavchkov committed Feb 4, 2024
commit 52fc53757a3f9cc50589194c75b3ce6b4604455a
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,9 @@ class FSTestBackupDir(TestBackupDir):

def __init__(self, *, rel_path, backup):
backup_prefix = os.environ.get('PG_PROBACKUP_TEST_BACKUP_DIR_PREFIX')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Получение параметров окружения нужно делать в init_helpers.py, иначе будет дубликация кода - в s3_backup.py тоже нужно будет добавить.

Copy link
Contributor

Choose a reason for hiding this comment

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

Для S3 я планирую перенести присвоение self.path в базовый класс, чтобы сделать пути в S3 и не в S3 одинаковыми. Но это требует предварительной проверки и будет делаться в рамках отдельногно PR.

if backup_prefix:
if not os.path.isabs(backup_prefix):
raise Exception(f"PG_PROBACKUP_TEST_BACKUP_DIR_PREFIX must be an absolute path, current value: {backup_prefix}")
self.path = os.path.join(backup_prefix, rel_path, backup)
else:
self.path = os.path.join(init_params.tmp_path, rel_path, backup)
if not os.path.isabs(backup_prefix):
raise Exception(f"PG_PROBACKUP_TEST_BACKUP_DIR_PREFIX must be an absolute path, current value: {backup_prefix}")
self.path = os.path.join(backup_prefix or init_params.tmp_path, rel_path, backup)
self.pb_args = ('-B', self.path)

def list_instance_backups(self, instance):
Expand Down
0