-
Notifications
You must be signed in to change notification settings - Fork 11
Log changes #166
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
Merged
Merged
Log changes #166
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
41805b7
Log changes
rane-rajasi d676cf3
Addressing feedback for: Log changes #1
rane-rajasi 35cf3c7
Merge branch 'master' into rarane-logchanges
rane-rajasi 707b558
Adding some missing UTs for: Log changes
rane-rajasi 098675f
Addressing feedback for: Log changes #2
rane-rajasi 90f1eaa
Addressing more UTs for: Log changes
rane-rajasi dc0d345
Addressing feedback for: Log changes #2
rane-rajasi 3756637
Minor changes/cleanup for: Log changes
rane-rajasi 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| from __future__ import print_function | ||
| import base64 | ||
| import datetime | ||
| import glob | ||
| import json | ||
| import os | ||
| import re | ||
|
|
@@ -428,6 +429,27 @@ def write_with_retry_using_temp_file(file_path, data, mode='w'): | |
| else: | ||
| raise Exception("Unable to write to {0} (retries exhausted). Error: {1}.".format(str(file_path), repr(error))) | ||
|
|
||
| @staticmethod | ||
| def delete_files_from_dir(dir_name, file_identifier_list, raise_if_delete_failed=False): | ||
| """ Clears all files from given dir. NOTE: Uses file_identifier_list to determine the content to delete """ | ||
| for file_identifier in file_identifier_list: | ||
| files_to_delete = glob.glob(str(dir_name) + "/" + str(file_identifier)) | ||
|
|
||
| for file_to_delete in files_to_delete: | ||
| try: | ||
| os.remove(file_to_delete) | ||
| except Exception as error: | ||
| error_message = "Unable to delete files from directory [Dir={0}][File={1}][Error={2}][RaiseIfDeleteFailed={3}].".format( | ||
| str(dir_name), | ||
| str(file_to_delete), | ||
| repr(error), | ||
| str(raise_if_delete_failed)) | ||
|
|
||
| if raise_if_delete_failed: | ||
| raise Exception(error_message) | ||
| else: | ||
| print(error_message) | ||
|
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. nit: is print here a debug statement?
Contributor
Author
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. We don't have a logger reference in EnvLayer so print is the way to log if needed |
||
| return None | ||
| # endregion - File system emulation and extensions | ||
|
|
||
| # region - DateTime emulation and extensions | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.