grokability / jamf2snipe

Import and sync assets from a JAMFPro instance to Snipe-IT asset management.
MIT License
108 stars 55 forks source link

Line 266 error #1

Closed inkaudio closed 5 years ago

inkaudio commented 5 years ago

Traceback (most recent call last): File "./jamf2snipe", line 266, in payload = {snipekey: jamf['{}'.format(jamfsplit[0])]['{}'.format(jamfsplit[1])]} KeyError: 'name'

ParadoxGuitarist commented 5 years ago

inkaudio, Can you submit a scrubbed version of your settings.conf as well as any text output while running the command? I'm using:

[api-mapping]
name = general name

I can't reproduce this on my end and I think it's something to do with your settings file, but you might include the installed version of python that you're using while we're collecting data. The error is point toward pulling out the key/value from the settings file. Essentially from the lines above line 266 should be: payload ={name: jamf['general']['name']}

I think you can debug that, by adding a line between 265 and 266: print("payload = {}: jamf['{}']['{}']}".format(snipekey, jamfsplit[0], jamfsplit[1]))

The only other thing I can think of is that your returned json from the JAMF Pro Instance doesn't contain that key/value, so maybe let's include your JAMF Pro/JSS Version while we're at it.

Thanks!