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

Retire support for storage v6 #1924

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
16 changes: 2 additions & 14 deletions lib/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,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, 6}): # initialize/upgrade
elif (v_found is None): # initialize/upgrade
alstar555 marked this conversation as resolved.
Show resolved Hide resolved
ch.INFO("%s storage directory: v%d %s"
% (op, STORAGE_VERSION, self.root))
self.root.mkdir()
Expand All @@ -1188,16 +1188,6 @@ def init(self):
self.build_large.mkdir()
self.unpack_base.mkdir()
self.upload_cache.mkdir()
if (v_found is not None): # upgrade
if (v_found == 6):
# Charliecloud 0.32 had a bug where symlinks to fat manifests
# that were really skinny were erroneously absolute, making the
# storage directory immovable (PR #1657). Remove all symlinks
# in dlcache; they’ll be re-created later.
for entry in self.download_cache.iterdir():
if (entry.is_symlink()):
ch.DEBUG("deleting bad v6 symlink: %s" % entry)
entry.unlink()
self.version_file.file_write("%d\n" % STORAGE_VERSION)
else: # can’t upgrade
ch.FATAL("incompatible storage directory v%d: %s"
Expand Down Expand Up @@ -1294,10 +1284,8 @@ def validate_strict(self):
% (msg_prefix, img), ch.BUG_REPORT_PLZ)

def version_read(self):
# 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
ch.FATAL('Expected file "%s" not found' % self.version_file)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we instead omit this whole check, and add the version file to valid_p per #1147, which you would then add to this PR?

text = self.version_file.file_read_all()
try:
return int(text)
Expand Down
Loading