@@ -124,10 +124,7 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
124124self .execution_time = end_time - start_time
125125
126126if 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 ()
131128else :
132129result = self .test_class .output
133130if expect_error is True :
@@ -144,6 +141,19 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
144141else :
145142raise ProbackupException (self .test_class .output ,self .test_class .cmd )
146143
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+
147157def init (self ,options = None ,old_binary = False ,skip_log_directory = False ,expect_error = False ,use_backup_dir = True ):
148158if options is None :
149159options = []