Fix incorrect reporting when fs_hash.sh fails#364
Merged
nishakm merged 1 commit intotern-tools:masterfrom Aug 5, 2019
Merged
Conversation
Contributor
Author
|
Labeled this as WIP so @nishakm may review and provide feedback. Output of running Tern on a system without attr installed is: |
87b1224 to
6aa3afe
Compare
Currently, if there is any failure in the fs_hash.sh script, the only erro message that gets reported is: WARNING - report - Cannot retrieve full image metadata. It is common to see this warning message when attr is not installed in a Linux environment or if you try to run the script natively on MacOS. The current error message is not helpful for users trying to understand the output file. The following commit adapts the fs_hash.sh script to check for the availability of the three central commands in the script: find, sha256sum and getfattr before it runs. If any of these commands are not available, the script will exit with a more helpful error message. Finally, tern/utils/rootfs.py was modified to properly log the error message from pipes.communicate(). Resolves tern-tools#263 Signed-off-by: Rose Judge <rjudge@vmware.com>
6aa3afe to
6569358
Compare
Contributor
Author
|
This PR is now ready for formal review. |
Contributor
|
Looks good to me. Reviewed test with @rnjudge on a call. Merging now. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently, if there is any failure in the fs_hash.sh script, the only
erro message that gets reported is:
WARNING - report - Cannot retrieve full image metadata.
It is common to see this warning message when attr is not installed in a
Linux environment or if you try to run the script natively on MacOS.
The current error message is not helpful for users trying to understand
the output file.
The following commit adapts the fs_hash.sh script to check for the
availability of the three central commands in the script: find,
sha256sum and getfattr before it runs. If any of these commands are
not available, the script will exit with a more helpful error message.
Finally, tern/utils/rootfs.py was modified to properly log the error
message from pipes.communicate().
Resolves #263
Signed-off-by: Rose Judge rjudge@vmware.com