Skip to content

Commit

Permalink
Merge pull request #245 from cumulus-nasa/CUMULUS-404
Browse files Browse the repository at this point in the history
CUMULUS-404 Add useList to parsePDR
  • Loading branch information
kkelly51 committed Mar 15, 2018
2 parents 2843d0a + 2738bf6 commit 69167ca
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
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/spec/v2.0.0.

## [Unreleased]

### Added
- added flag `useList` to parse-pdr [CUMULUS-404]

## [v1.1.3] - 2018-03-14
### Fixed
- Changed @cumulus/deployment package install behavior. The build process will happen after installation
Expand Down
3 changes: 2 additions & 1 deletion cumulus/tasks/parse-pdr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function parsePdr(event) {
config.stack,
config.bucket,
config.collection,
provider
provider,
config.useList
);

return parse.ingest()
Expand Down
5 changes: 5 additions & 0 deletions cumulus/tasks/parse-pdr/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
"name": { "type": "string" },
"granuleIdExtraction": { "type": "string" }
}
},
"useList": {
"description": "flag to tell ftp server to use 'LIST' instead of 'STAT'",
"default": false,
"type": "boolean"
}
}
}
1 change: 1 addition & 0 deletions cumulus/tasks/parse-pdr/tests/parse_pdrs_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test('parse PDR from FTP endpoint', async (t) => {
username: 'testuser',
password: 'testpass'
};
newPayload.config.useList = true;

await validateConfig(t, newPayload.config);

Expand Down
2 changes: 2 additions & 0 deletions packages/ingest/pdr.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class Parse {
bucket,
collection,
provider,
useList = false,
folder = 'pdrs') {
if (this.constructor === Parse) {
throw new TypeError('Can not construct abstract class.');
Expand All @@ -117,6 +118,7 @@ class Parse {
this.collection = collection;
this.provider = provider;
this.folder = folder;
this.useList = useList;

this.port = get(this.provider, 'port', 21);
this.host = get(this.provider, 'host', null);
Expand Down

0 comments on commit 69167ca

Please sign in to comment.