I've updated this Python script to work on Big Sur, using all of the python3 modules instead. Admittedly, I'm not a Python expert by any means, so this could be an issue with the code. The new, python3 version of the script can be found: here.
In any case, I'm receiving the error Script result: macOS 11 or later required ! with exit code 134 upon executing the script on my machine via a policy invoked in Self Service.
My environment:
Python ver 3.9.1
Xcode command line tools installed
macOS Big Sur 11.1
I couldn't find much about this online or on Jamf Nation. Has anyone run into this error before?
Best answer by ryonriley
@tlarkin Great point, and your reply ultimately helped me figure out the solution. I'm starting to think that we should ship our own as well. I finally got this script to work after a ton of iterations. What I had to do was:
Change python env on the script to my local, #!/usr/local/bin/python3
Install the pyobjc module and import it into my script, import objc
Import the SSL module, import ssl
Allow untrusted certs for the Jamf API calls by adding this to my httplib requests: context=ssl._create_unverified_context()
After all of that, success:
Thank you (and everyone else) for helping me figure this out!
gotcha so that installs Python into the system path, which we avoid here. when you call your code you have to ensure you are using the env you mean vs system defaults. So, we ship our own py3 env to /opt/myorg/bin/python3 and keep it out of standard path. This may not even be an issue for you, but thought it was worth to at least bring up
@tlarkin Great point, and your reply ultimately helped me figure out the solution. I'm starting to think that we should ship our own as well. I finally got this script to work after a ton of iterations. What I had to do was:
Change python env on the script to my local, #!/usr/local/bin/python3
Install the pyobjc module and import it into my script, import objc
Import the SSL module, import ssl
Allow untrusted certs for the Jamf API calls by adding this to my httplib requests: context=ssl._create_unverified_context()
After all of that, success:
Thank you (and everyone else) for helping me figure this out!
@ryonriley yeah that httplib thing can be annoying but this is due to trust stores, and Python has its own trust store. Just like java does, macOs does, Windows does, and some browsers do as well. You can add root certs to your env's trust store but not sure I would go that route personally. I feel there are risks in that regard.
For what it is worth I wrote a blog post on how we ship our own py3 env here at my org, found here
@ryonriley I have been shipping my own for about 2 years now. Python 3 objc bridge xattr + request. we also keep our py3 env out of standard $PATH on purpose
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.