grahampugh/jamf-upload

JamfComputerGroupUploader Error Finding Template

Opened this issue · 1 comments

I have a local repo with the following structure
Main
-> JAMF_PreProduction_Policies
-->SomeRecipe.jamf.recipe.yaml
-> Templates
--> JAMF-StaticGroup.xml

So basically the at the root, I have two directories, one with all the recipes, and another with templates. In an earlier release of this processor, everything was working fine. I recently updated and now getting where it cannot find the template xml. Here is an output of the error

JamfComputerGroupUploader: Matching dir: /Users/autopkg/Library/AutoPkg/RecipeOverrides
JamfComputerGroupUploader: Looking for JAMF-StaticGroup.xml in /Users/autopkg/Library/AutoPkg/RecipeOverrides
JamfComputerGroupUploader: Matching dir: /Users/autopkg/Library/AutoPkg/RecipeOverrides
JamfComputerGroupUploader: Parent Recipe: /Volumes/DataVolume01/Autopkg/LocalRecipes/JAMF_PreProduction_Policies/SomeRecipe.jamf.recipe.yaml
JamfComputerGroupUploader: Matching dir: /Volumes/DataVolume01/Autopkg/LocalRecipes/JAMF_PreProduction_Policies
JamfComputerGroupUploader: Matching dir: /Volumes/DataVolume01/Autopkg/LocalRecipes/JAMF_PreProduction_Policies
JamfComputerGroupUploader: Matching dir: /Volumes/DataVolume01/Autopkg/LocalRecipes/JAMF_PreProduction_Policies
Traceback (most recent call last):
  File "/Library/AutoPkg/autopkglib/__init__.py", line 840, in process
    self.env = processor.process()
  File "/Library/AutoPkg/autopkglib/__init__.py", line 626, in process
    self.main()
  File "/Volumes/DataVolume01/Autopkg/RecipeRepo/com.github.autopkg.grahampugh-recipes/JamfUploaderProcessors/JamfComputerGroupUploader.py", line 170, in main
    raise ProcessorError(
autopkglib.ProcessorError: ERROR: Computer Group file JAMF-StaticGroup.xml not found
  File "/Library/AutoPkg/autopkglib/__init__.py", line 840, in process
    self.env = processor.process()
ERROR: Computer Group file JAMF-StaticGroup.xml not found
Failed.

What I figured out is that I needed to add to the search directories the current directory I was operating in. Even though my search directories is set with a '.', the processor was not searching it.

At least this could be documented or another condition can be added to search within the current directory IF there is a '.' in the existing REPO_SEARCH_DIR array.

Sorry, I don't quite understand I needed to add to the search directories the current directory I was operating in. Even though my search directories is set with a '.', the processor was not searching it.

The search locations are described in the wiki:
https://github.com/grahampugh/jamf-upload/wiki/JamfUploader-Templates#where-to-store-templates

It looks like you are using a local folder rather than a repo. That's probably why you have had to add that directory into the RECIPE_SEARCH_DIRS just as you would any real repo.