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

importer logs an error when trying to create a custom_link to a Secret model which is removed in Nautobot #55

Open
lvrfrc87 opened this issue Jun 23, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@lvrfrc87
Copy link

Environment

  • Python version: 3.9.1
  • Nautobot version: 1.0.2
  • nautobot-netbox-importer version: 1.0.3

Expected Behavior

Imports to Secret should be skipped

Observed Behavior

importer return error when trying to create a custom_link to a Secret model which is removed in Nautobot

10:42:06 error    Nautobot reported a database integrity error
  action: create
  exception: null value in column "content_type_id" violates not-null constraint
DETAIL:  Failing row contains (f8f14a85-390f-59d1-937c-e8e0e94ddc47, 2021-06-23, 2021-06-23 10:42:06.834875+00, HP NA, HP-NA, {% if obj.primary_ip %}https://im-na.wdf.sap.corp/search.do?devi..., 100, CND, default, t, null).
  model: <class 'nautobot.extras.models.models.CustomLink'>
  model_data:
    {'button_class': 'default',
     'content_type': None,
     'created': None,
     'group_name': 'CND',
     'name': 'HP NA',
     'new_window': True,
     'pk': UUID('f8f14a85-390f-59d1-937c-e8e0e94ddc47'),
     'target_url': '{% if obj.primary_ip '
                   '%}https://im-na.wdf.sap.corp/search.do?device={{ '
                   'obj.primary_ip.address.ip '
                   '}}&pageTitle=Device+Search+Results&fo_device=contains&filterName=searchdevice&fo_managementStatus=equals&managementStatus=0&managementStatus=1&managementStatus=3&mergeMode=replace&basic=true&sortBy=hostName&filterType=Device&quickSearch=1{% '
                   'endif %}',
     'text': 'HP-NA',
     'weight': 100}
@glennmatthews glennmatthews added the bug Something isn't working label Jun 25, 2021
@glennmatthews glennmatthews changed the title importer return error when trying to create a custom_link to a Secret model which is removed in Nautobot importer logs an error when trying to create a custom_link to a Secret model which is removed in Nautobot Jun 25, 2021
@glennmatthews
Copy link
Contributor

Needs to be handled more generally in the case of CustomField/CustomLink/ExportTemplate/ObjectChange/etc. referencing a content-type that has no Nautobot equivalent. Probably a prerequisite for #58 and its sequels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants