Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Fields are required #14

Open
gohv opened this issue Nov 20, 2023 · 2 comments
Open

Custom Fields are required #14

gohv opened this issue Nov 20, 2023 · 2 comments
Assignees

Comments

@gohv
Copy link

gohv commented Nov 20, 2023

Hello!

In the settings.conf.example its stated that custom fields are not required unless

Custom fieldset values are not required unless mapping Kandji data to Snipe-IT custom fields

I am not mapping custom fields, we dont use any.
After configuring settings.conf and running kandji2snipe I get errors for custom fields:

First it was:

    if config['snipe-it']['mac_custom_fieldset_id'] != "":
       ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/configparser.py", line 1273, in __getitem__
    raise KeyError(key)

I added the field to settings.conf and now I am getting:

    for key in config['mac-api-mapping']:
               ~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/configparser.py", line 979, in __getitem__
    raise KeyError(key)

Am I missing some config in the script?

image
@briangoldstein
Copy link
Collaborator

@gohv Sorry about that, I will get some logic added to the script to not require the fields when custom mapping is not used. For the time being, you can add the following lines to your settings.conf file to avoid the validation errors. No need to add any values.

mac_custom_fieldset_id = 
iphone_custom_fieldset_id = 
ipad_custom_fieldset_id = 
appletv_custom_fieldset_id = 
[mac-api-mapping]
[iphone-api-mapping]
[ipad-api-mapping]
[appletv-api-mapping]

@gohv
Copy link
Author

gohv commented Dec 21, 2023

Thank for the answer @briangoldstein !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants