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

null status on device interface created through template #2419

Closed
jakubkrysl opened this issue Sep 14, 2022 · 5 comments · Fixed by #2698
Closed

null status on device interface created through template #2419

jakubkrysl opened this issue Sep 14, 2022 · 5 comments · Fixed by #2698
Assignees
Labels
type: bug Something isn't working as expected

Comments

@jakubkrysl
Copy link

jakubkrysl commented Sep 14, 2022

Environment

  • Nautobot version (Docker tag too if applicable): 1.4.1
  • Python version: 3.10
  • Database platform, version:
  • Middleware(s):

#1753 introduced status field for interfaces. We have interface templates on some device types. If we create new device (tested via UI and csv import) with type containing interface template, the newly created device has interface without status set.
Creating device interface directly without status is not possible, the field is required.

Steps to Reproduce

  1. Create device type
  2. Add interface to the device type (no field 'status' there)
  3. Create device with that device type

Expected Behavior

Newly created interface on the new device has status filled

Observed Behavior

Newly created interface on the new device has empty status

TODO

  • Add status as an option to interface templates on device templates
  • For migration, we should default existing templates to "Active" status, if it doesn't exist create it
  • For backwards compatibility, no specifying a status should default to "Active" status, throw error if it does not exist
@glennmatthews glennmatthews added type: bug Something isn't working as expected group: dcim labels Sep 14, 2022
@glennmatthews
Copy link
Contributor

Thanks for the report! A "simple" fix might be to just set status Active for all new interfaces created from templates; but I wonder if a more desirable solution might be to allow individual interface templates to actually specify their default creation status.

@martin-networker
Copy link

@glennmatthews Device type/template usually contains only physical interfaces because virtual interfaces vary device by device. With physical interfaces I doubt that any customer will have same sort of ports active from implementation. So as per my opinion the solution: set status Active for all new interfaces created from templates is great.

@jakubkrysl
Copy link
Author

Thanks for the fast reply! The extra status on device templates is not much usable for us, but others might like it. I'll leave that part completely on you :)
just IMHO the fix should contain DB migration to add missing statuses, as #1753 added 'active' statuses to all interfaces when introducing the filed.

@glennmatthews
Copy link
Contributor

Good points, thank you both! I suspect that rather than a new DB migration, we'll want to add a management command similar to nautobot-server fix_custom_fields, nautobot-server trace_paths, etc. that can be run as a one-off (or as part of the nautobot-server post_upgrade command) to fix up any interfaces that may be missing statuses.

@smk4664
Copy link
Contributor

smk4664 commented Sep 19, 2022

This may be something that we want configurable in settings. I know of an instance of Nautobot that uses its own statuses and has removed built-in statuses.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
6 participants