From 545bbf8ba42e01587650e905729af8545981c663 Mon Sep 17 00:00:00 2001 From: vshepard Date: Sun, 21 Jul 2024 23:33:21 +0200 Subject: [PATCH] show_archive add print tli --- .../pg_probackup2/pg_probackup2/app.py | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/testgres/plugins/pg_probackup2/pg_probackup2/app.py b/testgres/plugins/pg_probackup2/pg_probackup2/app.py index e656b66d..7f326b9c 100644 --- a/testgres/plugins/pg_probackup2/pg_probackup2/app.py +++ b/testgres/plugins/pg_probackup2/pg_probackup2/app.py @@ -554,6 +554,9 @@ def show_archive( # You should print it when calling as_text=true return self.run(cmd_list + options, old_binary=old_binary, expect_error=expect_error) + result = {} + instance_timelines = None + if as_json: if as_text: data = self.run(cmd_list + options, old_binary=old_binary, expect_error=expect_error) @@ -561,28 +564,34 @@ def show_archive( data = json.loads(self.run(cmd_list + options, old_binary=old_binary, expect_error=expect_error)) if instance: - instance_timelines = None for instance_name in data: if instance_name['instance'] == instance: instance_timelines = instance_name['timelines'] break if tli > 0: + timeline_found = False for timeline in instance_timelines: if timeline['tli'] == tli: - return timeline - - return {} - - if instance_timelines: - return instance_timelines - - return data + result = timeline + timeline_found = True + break + if not timeline_found: + result = {} + + elif instance_timelines: + result = instance_timelines + else: + result = data + else: + result = data else: - show_splitted = self.run(cmd_list + options, old_binary=old_binary, - expect_error=expect_error).splitlines() - logging.error(show_splitted) + show_splitted = self.run(cmd_list + options, old_binary=old_binary, expect_error=expect_error).splitlines() + print(show_splitted) exit(1) + if result == {}: + print(f"tli={tli} was not found. {instance_timelines}") + return result def validate( self, instance=None, backup_id=None, 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