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
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