@@ -124,10 +124,7 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
124
124
self .execution_time = end_time - start_time
125
125
126
126
if command [0 ]== 'backup' and return_id :
127
- # return backup ID
128
- for line in self .test_class .output .splitlines ():
129
- if 'INFO: Backup' and 'completed' in line :
130
- result = line .split ()[2 ]
127
+ result = self .get_backup_id ()
131
128
else :
132
129
result = self .test_class .output
133
130
if expect_error is True :
@@ -144,6 +141,19 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
144
141
else :
145
142
raise ProbackupException (self .test_class .output ,self .test_class .cmd )
146
143
144
+ def get_backup_id (self ):
145
+ if init_params .major_version > 2 :
146
+ pattern = re .compile (r"Backup (.*) completed successfully." )
147
+ for line in self .test_class .output .splitlines ():
148
+ match = pattern .search (line )
149
+ if match :
150
+ return match .group (1 )
151
+ else :
152
+ for line in self .test_class .output .splitlines ():
153
+ if 'INFO: Backup' and 'completed' in line :
154
+ return line .split ()[2 ]
155
+ return None
156
+
147
157
def init (self ,options = None ,old_binary = False ,skip_log_directory = False ,expect_error = False ,use_backup_dir = True ):
148
158
if options is None :
149
159
options = []