diff --git a/CHANGELOG.md b/CHANGELOG.md index 75e8352d17a..be33ce246d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cumulus/tasks/parse-pdr/index.js b/cumulus/tasks/parse-pdr/index.js index 8aa992b8cfc..b4987abb48a 100644 --- a/cumulus/tasks/parse-pdr/index.js +++ b/cumulus/tasks/parse-pdr/index.js @@ -32,7 +32,8 @@ function parsePdr(event) { config.stack, config.bucket, config.collection, - provider + provider, + config.useList ); return parse.ingest() diff --git a/cumulus/tasks/parse-pdr/schemas/config.json b/cumulus/tasks/parse-pdr/schemas/config.json index 23b94ab5af7..bc88e837665 100644 --- a/cumulus/tasks/parse-pdr/schemas/config.json +++ b/cumulus/tasks/parse-pdr/schemas/config.json @@ -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" } } } diff --git a/cumulus/tasks/parse-pdr/tests/parse_pdrs_test.js b/cumulus/tasks/parse-pdr/tests/parse_pdrs_test.js index a15399750cf..0cb3ff3d98d 100644 --- a/cumulus/tasks/parse-pdr/tests/parse_pdrs_test.js +++ b/cumulus/tasks/parse-pdr/tests/parse_pdrs_test.js @@ -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); diff --git a/packages/ingest/pdr.js b/packages/ingest/pdr.js index afe3d5b747b..0d93dd36288 100644 --- a/packages/ingest/pdr.js +++ b/packages/ingest/pdr.js @@ -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.'); @@ -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);