@@ -554,35 +554,44 @@ def show_archive(
554
554
# You should print it when calling as_text=true
555
555
return self .run (cmd_list + options , old_binary = old_binary , expect_error = expect_error )
556
556
557
+ result = {}
558
+ instance_timelines = None
559
+
557
560
if as_json :
558
561
if as_text :
559
562
data = self .run (cmd_list + options , old_binary = old_binary , expect_error = expect_error )
560
563
else :
561
564
data = json .loads (self .run (cmd_list + options , old_binary = old_binary , expect_error = expect_error ))
562
565
563
566
if instance :
564
- instance_timelines = None
565
567
for instance_name in data :
566
568
if instance_name ['instance' ] == instance :
567
569
instance_timelines = instance_name ['timelines' ]
568
570
break
569
571
570
572
if tli > 0 :
573
+ timeline_found = False
571
574
for timeline in instance_timelines :
572
575
if timeline ['tli' ] == tli :
573
- return timeline
574
-
575
- return {}
576
-
577
- if instance_timelines :
578
- return instance_timelines
579
-
580
- return data
576
+ result = timeline
577
+ timeline_found = True
578
+ break
579
+ if not timeline_found :
580
+ result = {}
581
+
582
+ elif instance_timelines :
583
+ result = instance_timelines
584
+ else :
585
+ result = data
586
+ else :
587
+ result = data
581
588
else :
582
- show_splitted = self .run (cmd_list + options , old_binary = old_binary ,
583
- expect_error = expect_error ).splitlines ()
584
- logging .error (show_splitted )
589
+ show_splitted = self .run (cmd_list + options , old_binary = old_binary , expect_error = expect_error ).splitlines ()
590
+ print (show_splitted )
585
591
exit (1 )
592
+ if result == {}:
593
+ print (f"tli={ tli } was not found. { instance_timelines } " )
594
+ return result
586
595
587
596
def validate (
588
597
self , instance = None , backup_id = None ,
0 commit comments