jssimporter / JSSImporter

JSSImporter is deprecated. Please see the wiki for alternatives
Apache License 2.0
145 stars 38 forks source link

'NSTaggedPointerString' object has no attribute 'get' #120

Closed Yohan460 closed 6 years ago

Yohan460 commented 6 years ago

JSSImporterZoom.log

Yohan460 commented 6 years ago

After doing a little debugging the error is caused by this line: https://github.com/sheagcraig/JSSImporter/blob/v1.0.0-beta2/JSSImporter.py#L375

sheagcraig commented 6 years ago

Hi @Yohan460 Thanks for sending me this.

Without the full traceback, I'm a little more lost here, so if you could recreate it through the debugging you did earlier, that would probably help.

The error to me appears that what is happening is freaking out because something is calling the python dictionary get() method, but instead of a variable being a python dictionary, it's actually an NSTaggedPointerString, which has no idea what the get() method is.

I agree with your pointing to the processing of environment variables, because these are probably picked up by AutoPkg using PyObjC and using NSUserDefaults, which is why the values would be NSTaggedPointerString instead of a native python string or dict.

So I think we're on the right track-let's look at full call stack in the traceback and see if that gives any hints as to which one of these args might be the bad one. From your log, they all look perfectly fine...

Well, wait. Your JSS_REPOS value is a dict, with key 0 having a value of another dict for the repo.

This may be just the way AutoPkg is formatting it for output, but JSS_REPOS value should be a list of dicts, not a dict of dicts.

i.e. in the prefs file:

<key>JSS_REPOS</key>
<array>
    <dict>
        <key>URL</key>
        <string>secret</string>
        <key>name</key>
        <string>DDS DP</string>
        <key>type</key>
        <string>SMB</string>
    </dict>
</array>
Yohan460 commented 6 years ago

Was an issue with the syntax of the JSS_REPOS, was set correctly in Xcode, but upon looking a the plist directly I saw that there was a key associated with the nested dict for some reason,.