Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

drop support for storage v3 #1801

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ def init(self):
if (v_found == STORAGE_VERSION):
ch.VERBOSE("found storage dir v%d: %s" % (STORAGE_VERSION, self.root))
self.lock()
elif (v_found in {None, 3, 4, 5, 6}): # initialize/upgrade
elif (v_found in {None, 4, 5, 6}): # initialize/upgrade
ch.INFO("%s storage directory: v%d %s"
% (op, STORAGE_VERSION, self.root))
self.root.mkdir()
Expand Down Expand Up @@ -1199,7 +1199,7 @@ def init(self):
else: # can’t upgrade
ch.FATAL("incompatible storage directory v%d: %s"
% (v_found, self.root),
'you can delete and re-initialize with “ch-image reset”')
"you can delete and re-initialize with “ch-image reset”")
self.validate_strict()
self.cleanup()

Expand Down Expand Up @@ -1291,15 +1291,15 @@ def validate_strict(self):
% (msg_prefix, img), ch.BUG_REPORT_PLZ)

def version_read(self):
if (os.path.isfile(self.version_file)):
# WARNING: version_file might not be Path
text = self.version_file.file_read_all()
try:
return int(text)
except ValueError:
ch.FATAL('malformed storage version: "%s"' % text)
else:
# While support for storage v1 was dropped some time ago, let’s at least
# retain the ability to recognize it.
if (not os.path.isfile(self.version_file)):
return 1
text = self.version_file.file_read_all()
try:
return int(text)
except ValueError:
ch.FATAL('malformed storage version: "%s"' % text)


class TarFile(tarfile.TarFile):
Expand Down