Skip to content

Commit 99e989c

Browse files
author
Stepan Neretin
committed
review fixes
1 parent 070d7c3 commit 99e989c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pg_probackup2/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def show(
571571
backup_list.append(backup)
572572

573573
if backup_id is not None:
574-
assert False, "Failed to find backup with ID: {0}".format(backup_id)
574+
raise RuntimeError("Failed to find backup with ID: {0}".format(backup_id))
575575

576576
return backup_list
577577
else:
@@ -629,7 +629,7 @@ def show(
629629
specific_record[name.strip()] = var
630630

631631
if not specific_record:
632-
assert False, "Failed to find backup with ID: {0}".format(backup_id)
632+
raise RuntimeError("Failed to find backup with ID: {0}".format(backup_id))
633633

634634
return specific_record
635635

@@ -782,8 +782,8 @@ def set_archiving(
782782
instances_json = self.show(instance=None, as_json=True, expect_error=False, as_text=True)
783783
instances_data = json.loads(instances_json)
784784
if not any(inst_data.get('instance') == instance for inst_data in instances_data):
785-
assert False, "Instance '{0}' does not exist. " \
786-
"Please add the instance first using add_instance() or init_pb_node().".format(instance)
785+
raise RuntimeError("Instance '{0}' does not exist. " \
786+
"Please add the instance first using add_instance() or init_pb_node().".format(instance))
787787

788788
# parse postgresql.auto.conf
789789
options = {}

0 commit comments

Comments
 (0)