Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Fixed
- extractor would fail on empty dataset download [#36](https://github.com/clowder-framework/pyclowder/issues/36)

### Added
- ability to set the heartbeat for an extractractor [#42](https://github.com/clowder-framework/pyclowder/issues/42)

Expand Down
14 changes: 10 additions & 4 deletions pyclowder/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ def _download_file_metadata(self, host, secret_key, fileid, filepath):
return (md_dir, md_file)

def _prepare_dataset(self, host, secret_key, resource):
logger = logging.getLogger(__name__)

file_paths = []
located_files = []
missing_files = []
tmp_files_created = []
Expand Down Expand Up @@ -354,10 +357,13 @@ def _prepare_dataset(self, host, secret_key, resource):

# If we didn't find any files locally, download dataset .zip as normal
else:
inputzip = pyclowder.datasets.download(self, host, secret_key, resource["id"])
file_paths = pyclowder.utils.extract_zip_contents(inputzip)
tmp_files_created += file_paths
tmp_files_created.append(inputzip)
try:
inputzip = pyclowder.datasets.download(self, host, secret_key, resource["id"])
file_paths = pyclowder.utils.extract_zip_contents(inputzip)
tmp_files_created += file_paths
tmp_files_created.append(inputzip)
except Exception as e:
logger.exception("No files found and download failed")

return (file_paths, tmp_files_created, tmp_dirs_created)

Expand Down