Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUMULUS-404 Add useList to parsePDR #245

Merged
merged 11 commits into from
Mar 15, 2018
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- added tools to @cumulus/integration-tests for local integration testing
- added end to end testing for discovering and parsing of PDRs
- `yarn e2e` command is available for end to end testing
- added flag `useList` to parse-pdr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go under an 'Added' header in the 'Unreleased' section. Then, when we create a release, we'll add a header for that release.

### Fixed

- **CUMULUS-326: "Occasionally encounter "Too Many Requests" on deployment"** The api gateway calls will handle throttling errors
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