backup: fix restoring template VMs
os.path.splitext fails on path without proper file base name, like '/something/..000'. Use plain string methods (rsplit). Fixes QubesOS/qubes-issues#3167
This commit is contained in:
parent
17670eae1b
commit
9cdb2a8152
@ -630,8 +630,9 @@ class ExtractWorker3(Process):
|
||||
os.remove(filename)
|
||||
continue
|
||||
else:
|
||||
(basename, ext) = os.path.splitext(self.tar2_current_file)
|
||||
previous_chunk_number = int(ext[1:])
|
||||
# os.path.splitext fails to handle 'something/..000'
|
||||
(basename, ext) = self.tar2_current_file.rsplit('.', 1)
|
||||
previous_chunk_number = int(ext)
|
||||
expected_filename = basename + '.%03d' % (
|
||||
previous_chunk_number+1)
|
||||
if expected_filename != filename:
|
||||
|
Loading…
Reference in New Issue
Block a user