macadmins / sofa

SOFA | A MacAdmin's Simple Organized Feed for Apple Software Updates
https://sofa.macadmins.io
Apache License 2.0
162 stars 27 forks source link

update the quotations around model when using python2 #177

Closed bartreardon closed 1 month ago

bartreardon commented 1 month ago

update the quotations around model when using the python2 method for macOS 11 hosts. This fixes an issue where the model truncates on the comma (e.g. MacBookAir10,1 becomes MacBookAir10) and the lookup will then fail.

Before:

% python -c 'import sys, json; print json.load(sys.stdin)["Models"]['"$model"']["SupportedOS"][0]' < "$json_cache"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'MacBookAir10' is not defined

After:

% python -c 'import sys, json; print json.load(sys.stdin)["Models"]["'${model}'"]["SupportedOS"][0]' < "$json_cache"
Sequoia 15