Skip to content

JamfPackageUploader.py: Share does not dismount when Jamf Admin running #35

Open
@jazzace

Description

When running the processor JamfPackageUploader, if the pkg already exists and the replace_pkg variable is set to False (as it is by default), the SMB server will remain mounted.

Excerpt from successful run:

JamfPackageUploader: Checking for existing 'Firefox-78.6.0esr.pkg' on https://[JamfProServer]:8443
JamfPackageUploader: No existing cookie found - starting new session
JamfPackageUploader: ['/usr/bin/osascript', '-e', 'mount volume "smb://[JamfProServer]/VolumeName" as user name "user" with password "password"']
JamfPackageUploader: b'file VolumeName:\n'
JamfPackageUploader: No existing package found
JamfPackageUploader: Expected path: /Volumes/VolumeName/Packages/Firefox-78.6.0esr.pkg
JamfPackageUploader: Copying Firefox-78.6.0esr.pkg to /Volumes/VolumeName/Packages/Firefox-78.6.0esr.pkg
JamfPackageUploader: Package copy successful
Unmount successful for /Volumes/VolumeName
JamfPackageUploader: Creating package metadata
[etc.]

Run when package already exists:

JamfPackageUploader: Checking for existing 'Firefox-78.6.0esr.pkg' on https://[JamfProServer]:8443
JamfPackageUploader: No existing cookie found - starting new session
JamfPackageUploader: Package 'Firefox-78.6.0esr.pkg' already exists: ID 479
JamfPackageUploader: ['/usr/bin/osascript', '-e', 'mount volume "smb://[JamfProServer]/VolumeName" as user name "user" with password "password"']
JamfPackageUploader: b'file VolumeName:\n'
JamfPackageUploader: Existing package found: /Volumes/VolumeName/Packages/Firefox-78.6.0esr.pkg
JamfPackageUploader: Not replacing existing Firefox-78.6.0esr.pkg as 'replace_pkg' is set to False. Use replace_pkg='True' to enforce.
JamfPackageUploader: Setting for pkg metadata replacement: False
{'Output': {'pkg_name': 'Firefox-78.6.0esr.pkg'}}
Receipt written to /Users/tech/Library/AutoPkg/Cache/local.jamf.FirefoxESRSignedPkg-upload/receipts/local.jamf-receipt-20201216-110243.plist

Based on the fact that the processor already knows the package exists before it mounts it using AppleScript, the solution should probably be to not mount the share at all should the package exist and the replace_pkg variable not be set.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions