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

MunkiOptionalReceiptEditor.py Failure When MunkiImporter Doesn't Import an Item #827

Open
foigus opened this issue Sep 16, 2022 · 2 comments

Comments

@foigus
Copy link

foigus commented Sep 16, 2022

Original discussion here.

Examining the python code seems to say that Sam Keeley's MunkiPkginfoReceiptsEditor.py just exits when no pkginfo_repo_path is supplied:

       if len(self.env['pkginfo_repo_path']) < 1:
            self.output('empty pkginfo path')
            return

whereas the core MunkiOptionalReceiptEditor.py fails when no pkginfo_repo_path is supplied:

    def main(self):
        if len(self.env["pkginfo_repo_path"]) < 1:
            raise ProcessorError("You must specify at least one pkginfo repo path")
  • pkginfo_repo_path is required by both processors
  • It's reasonable to return a processor error when a required variable isn't passed into the processor
  • However pkginfo_repo_path is set to empty if MunkiImporter.py doesn't import an item
  • Not importing an item is arguably the most common case when using .munki recipes

It's reasonable for recipe authors to not need to check for munki_repo_changed being set to False and halt recipe execution purely because there was no import of an item into the Munki repo (example here).

Possible solutions:

  • Make pkginfo_repo_path not required
  • Assuming this processor is supposed to run after MunkiImporter, exit the processor with a no-op if pkginfo_repo_path is Empty
@nmcspadden
Copy link
Contributor

Should be fixed in the dev branch with bf9fa41.

@MScottBlake
Copy link

Is there a timeframe where we should expect this fix to be merged into master?

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

No branches or pull requests

3 participants