rename URLMirrorFetchStrategy to CacheURLFetchStrategy since it isnt used to manage all mirror URLs - just the cache (the specific behavior that a URL may refer to a stale resource doesn't necessarily apply to mirrors)

This commit is contained in:
Peter Scheibel 2016-06-08 09:57:56 -07:00
parent a2754894ea
commit 3b71d78f3c

View File

@ -352,15 +352,14 @@ def __str__(self):
return "[no url]"
class URLMirrorFetchStrategy(URLFetchStrategy):
"""The resource associated with a URL at a mirror may be out of date.
"""
class CacheURLFetchStrategy(URLFetchStrategy):
"""The resource associated with a cache URL may be out of date."""
def __init__(self, *args, **kwargs):
super(URLMirrorFetchStrategy, self).__init__(*args, **kwargs)
super(CacheURLFetchStrategy, self).__init__(*args, **kwargs)
@_needs_stage
def fetch(self):
super(URLMirrorFetchStrategy, self).fetch()
super(CacheURLFetchStrategy, self).fetch()
if self.digest:
try:
self.check()
@ -847,7 +846,7 @@ def store(self, fetcher, relativeDst):
def fetcher(self, targetPath, digest):
url = "file://" + join_path(self.root, targetPath)
return URLMirrorFetchStrategy(url, digest)
return CacheURLFetchStrategy(url, digest)
class FetchError(spack.error.SpackError):