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

Add check for meta.json file #251

Merged
merged 2 commits into from
Mar 4, 2020
Merged

Add check for meta.json file #251

merged 2 commits into from
Mar 4, 2020

Conversation

mzfr
Copy link
Collaborator

@mzfr mzfr commented Mar 2, 2020

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

@afeena afeena mentioned this pull request Mar 3, 2020
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
Copy link
Collaborator

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")
Copy link
Collaborator

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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afeena afeena merged commit 54a0750 into mushorg:master Mar 4, 2020
@afeena
Copy link
Collaborator

afeena commented Mar 4, 2020

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants