mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-15 07:10:56 +01:00
Merge pull request #203 from setrofim/master
resource getters: weaken File to also resove to directories
This commit is contained in:
commit
299b28b3c1
@ -235,8 +235,8 @@ class DependencyFileGetter(ResourceGetter):
|
|||||||
remote_path = os.path.join(self.mount_point, self.relative_path, resource.path)
|
remote_path = os.path.join(self.mount_point, self.relative_path, resource.path)
|
||||||
local_path = os.path.join(resource.owner.dependencies_directory, os.path.basename(resource.path))
|
local_path = os.path.join(resource.owner.dependencies_directory, os.path.basename(resource.path))
|
||||||
|
|
||||||
if not os.path.isfile(local_path) or force:
|
if not os.path.exists(local_path) or force:
|
||||||
if not os.path.isfile(remote_path):
|
if not os.path.exists(remote_path):
|
||||||
return None
|
return None
|
||||||
self.logger.debug('Copying {} to {}'.format(remote_path, local_path))
|
self.logger.debug('Copying {} to {}'.format(remote_path, local_path))
|
||||||
shutil.copy(remote_path, local_path)
|
shutil.copy(remote_path, local_path)
|
||||||
@ -384,7 +384,7 @@ class HttpGetter(ResourceGetter):
|
|||||||
url = urljoin(self.url, owner_name, asset['path'])
|
url = urljoin(self.url, owner_name, asset['path'])
|
||||||
local_path = _f(os.path.join(settings.dependencies_directory, '__remote',
|
local_path = _f(os.path.join(settings.dependencies_directory, '__remote',
|
||||||
owner_name, asset['path'].replace('/', os.sep)))
|
owner_name, asset['path'].replace('/', os.sep)))
|
||||||
if os.path.isfile(local_path) and not self.always_fetch:
|
if os.path.exists(local_path) and not self.always_fetch:
|
||||||
local_sha = sha256(local_path)
|
local_sha = sha256(local_path)
|
||||||
if local_sha == asset['sha256']:
|
if local_sha == asset['sha256']:
|
||||||
self.logger.debug('Local SHA256 matches; not re-downloading')
|
self.logger.debug('Local SHA256 matches; not re-downloading')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user