-
Notifications
You must be signed in to change notification settings - Fork 33
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
Issues/91 #92
Merged
Merged
Issues/91 #92
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
da0f2fa
added citation creation tests and functionality to subscriber and dow…
mike-gangl 660c526
added verbose option to create_citation_file command, previously hard…
mike-gangl c17d9ab
updated changelog (whoops) and fixed regression test:
mike-gangl 55050b8
updated request to include exec_info in warning; fixed issue with par…
mike-gangl e34e367
changed a warning to debug for citation file. fixed test issues
mike-gangl 753a6ee
Enable debug logging during regression tests and set max parallel wor…
c04039d
added output to pytest
mike-gangl 2373a02
Merge branch 'issues/91' of https://github.com/podaac/data-subscriber…
mike-gangl 5ad8e14
fixed test to only look for downlaoded data files not citation file d…
mike-gangl 492db44
added mock testing and retry on 503
mike-gangl 78aac3f
added 503 fixes
mike-gangl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,11 @@ def run(args=None): | |
except HTTPError as e: | ||
if e.code == 401: | ||
token = pa.refresh_token(token, 'podaac-subscriber') | ||
params['token'] = token | ||
# Updated: This is not always a dictionary... | ||
# in fact, here it's always a list of tuples | ||
for i, p in enumerate(params) : | ||
if p[1] == "token": | ||
params[i] = ("token", token) | ||
results = pa.get_search_results(params, args.verbose) | ||
else: | ||
raise e | ||
|
@@ -268,7 +272,9 @@ def run(args=None): | |
skip_cnt += 1 | ||
continue | ||
|
||
urlretrieve(f, output_path) | ||
pa.download_file(f,output_path) | ||
#urlretrieve(f, output_path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the commented out code |
||
|
||
pa.process_file(process_cmd, output_path, args) | ||
logging.info(str(datetime.now()) + " SUCCESS: " + f) | ||
success_cnt = success_cnt + 1 | ||
|
@@ -284,6 +290,14 @@ def run(args=None): | |
logging.info("Downloaded Files: " + str(success_cnt)) | ||
logging.info("Failed Files: " + str(failure_cnt)) | ||
logging.info("Skipped Files: " + str(skip_cnt)) | ||
|
||
#create citation file if success > 0 | ||
if success_cnt > 0: | ||
try: | ||
pa.create_citation_file(short_name, provider, data_path, token, args.verbose) | ||
except: | ||
logging.debug("Error generating citation",exc_info=True) | ||
|
||
pa.delete_token(token_url, token) | ||
logging.info("END\n\n") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency should probably use
@tenacity.retry
.Check out https://github.com/podaac/data-subscriber/pull/92/files/5ad8e149843d5499b8601740cbc963aaac0f46f5..78aac3ffb4d6586fbc796935e85e67df41f5b53b#diff-158519578c6b1bf3dc62de68856136d011247d7ed6b085dfb341dfe452d2a1cfR314