-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add check for meta.json file #251
Conversation
bin/snare
Outdated
|
||
This function makes sure none of the path in that is missing the `hash` value. | ||
|
||
refer to issue: https://github.com/mushorg/snare/issues/201 |
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.
No need for that
bin/snare
Outdated
@@ -176,6 +196,11 @@ if __name__ == '__main__': | |||
|
|||
with open(os.path.join(full_page_path, 'meta.json')) as meta: | |||
meta_info = json.load(meta) | |||
|
|||
if not check_meta_file(meta_info): | |||
print_color("meta.json is missing some hash values. Please clone the pages again.", "ERROR") |
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.
Is it a good idea to point exact missing values?
bin/snare
Outdated
@@ -34,6 +34,26 @@ from snare.utils import snare_helpers | |||
from snare.utils.snare_helpers import str_to_bool, print_color | |||
|
|||
|
|||
def check_meta_file(meta_info): |
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.
Maybe it's better to put it in utils? https://github.com/mushorg/snare/blob/master/snare/utils/snare_helpers.py
Looks good, thanks! |
@afeena as you said in this comment I've added a check for the
meta.json
file.Let me know if any other changes are required.