-
Notifications
You must be signed in to change notification settings - Fork 337
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 "postware" #851
base: main
Are you sure you want to change the base?
Add "postware" #851
Conversation
Created largely in support of https://github.com/jessepeterson/signware |
@@ -70,14 +70,13 @@ | |||
munki_version, darwin_version) | |||
|
|||
|
|||
def import_middleware(): | |||
'''Check munki folder for a python file that starts with 'middleware'. | |||
def import_middleware(file_prefix='middleware', globals_prefix='middleware', required_function_name='process_request_options'): |
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.
Run your changes through a PEP-8 checker; this line is definitely over 80 characters...
if postware: | ||
display.display_debug2('Processing options through postware') | ||
# postware module must have process_post_fetch function | ||
postware.process_post_fetch(url, destinationpath) |
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.
If the item is unchanged, the signature was checked during the initial download (unless you've just switched to checking signatures). Is there a good reason to check the signature again?
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.
I think the idea was that if the signature changed but the download itself hadn't (or vice-versa; basically just always try and check, rather than assuming too much), that we should re-run the postware (in the case of the signature-checking). Due to the fact we place it in a temp file the signature is always re-downloaded, however. Perhaps another postware function should be called (or a different argument/option supplied to the function to indicate the separate calls)? Or perhaps we should save the signaures along-side the cats/manifests? This way we could not download them over and over again.
I don't want the "postware" to be exclusively for signature checking - hopefully it's generic enough for other use cases, too.
"Postware" is like middleware but gets called when file downloads are completed.