You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Import of objectpermissions that have constraints consisting of a list of conditions such as
[{"name": "foo"}, {"name": "bar"}]
should work.
Observed Behavior
objectpermission : 0%| | 0/ 323 [00:00]17:15:54 error Invalid data according to internal data model
12:15:54§ comment: This may be an issue with your source data or may reflect a bug in this plugin.
12:15:54§ action: load
12:15:54§ exception: 1 validation error for ObjectPermission
12:15:54§ constraints
12:15:54§ value is not a valid dict (type=type_error.dict)
12:15:54§ model: objectpermission
12:15:54§ model_data:
12:15:54§ {'actions': '["view"]',
12:15:54§ 'constraints': [{'name': 'foo'}, {'name': 'bar'}],
12:15:54§ 'description': '',
12:15:54§ 'enabled': True,
12:15:54§ 'groups': [{'name': 'foobargrp'}],
12:15:54§ 'name': 'foobarperm',
12:15:54§ 'object_types': [{'app_label': 'tenancy', 'model': 'tenantgroup'},
12:15:54§ {'app_label': 'tenancy', 'model': 'tenant'}],
12:15:54§ 'pk': 308,
12:15:54§ 'users': [UUID('036b093d-d350-538e-bad9-1fd132b1f5fa')]}
In netbox, create a permission with the following properties
object_types: tenancy/tenant, tenancy/tenant group
constraints: [{"name": "foo"}, {"name": "bar"}]
Export netbox data
Import to nautobot...
The text was updated successfully, but these errors were encountered:
Environment
Expected Behavior
Import of objectpermissions that have constraints consisting of a list of conditions such as
[{"name": "foo"}, {"name": "bar"}]
should work.
Observed Behavior
objectpermission : 0%| | 0/ 323 [00:00]17:15:54 error Invalid data according to internal data model
12:15:54§ comment: This may be an issue with your source data or may reflect a bug in this plugin.
12:15:54§ action: load
12:15:54§ exception: 1 validation error for ObjectPermission
12:15:54§ constraints
12:15:54§ value is not a valid dict (type=type_error.dict)
12:15:54§ model: objectpermission
12:15:54§ model_data:
12:15:54§ {'actions': '["view"]',
12:15:54§ 'constraints': [{'name': 'foo'}, {'name': 'bar'}],
12:15:54§ 'description': '',
12:15:54§ 'enabled': True,
12:15:54§ 'groups': [{'name': 'foobargrp'}],
12:15:54§ 'name': 'foobarperm',
12:15:54§ 'object_types': [{'app_label': 'tenancy', 'model': 'tenantgroup'},
12:15:54§ {'app_label': 'tenancy', 'model': 'tenant'}],
12:15:54§ 'pk': 308,
12:15:54§ 'users': [UUID('036b093d-d350-538e-bad9-1fd132b1f5fa')]}
The model validation is overly restrictive in allowing only dict type while lists should also be allowed:
https://github.com/nautobot/nautobot-plugin-netbox-importer/blob/a225bc38b9ef51ff8d6f1fdc72dd5472eedf0b30/nautobot_netbox_importer/diffsync/models/users.py#L27
Steps to Reproduce
In netbox, create a permission with the following properties
object_types: tenancy/tenant, tenancy/tenant group
constraints: [{"name": "foo"}, {"name": "bar"}]
Export netbox data
Import to nautobot...
The text was updated successfully, but these errors were encountered: