grahampugh / jamf-upload

Scripts for uploading packages to Jamf Cloud
Apache License 2.0
149 stars 37 forks source link

'JamfPackageUploader' object has no attribute 'smb_shares' #81

Closed pticyn closed 1 year ago

pticyn commented 1 year ago

I'm not using SMB shares and hence have no SMB_* variables in my autopkg config. Today after updating jamf-upload repository I started getting these kind of errors upon running any recipe with JamfPackageUploader processor.

The following recipes failed:
    overrides/zoom-override.jamf.recipe.yaml
        Error in local.jamf.zoom-override: Processor: com.github.grahampugh.jamf-upload.processors/JamfPackageUploader: Error: 'JamfPackageUploader' object has no attribute 'smb_shares'

This simple fix alleviates that:


--- JamfPackageUploader.py.old  2022-10-14 10:09:35.000000000 +0300
+++ JamfPackageUploader.py  2022-10-14 10:10:06.000000000 +0300
@@ -673,6 +673,7 @@
         self.pkg_metadata_updated = False

         # Create a list of smb shares in tuples
+        self.smb_shares = []
         if self.env.get("SMB_URL"):
             if not self.env.get("SMB_USERNAME") or not self.env.get("SMB_PASSWORD"):
                 raise ProcessorError("SMB_URL defined but no credentials supplied.")
grahampugh commented 1 year ago

Good catch, thanks. Forgot to test without any SMB DPs. :) Should be fixed now.