-
Notifications
You must be signed in to change notification settings - Fork 1
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
[config-gen] Add interface speed from netbox #136
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good so far, also tested it and it works. Added a couple of comments.
raise ConfigException(f'Interface {iface.id} has a different speed than other ' | ||
f'member interface(s) of LAG {lag.id}, has {speed}, other(s) have ' | ||
f'{cls.lag_member_speed_cache[lag.id]}') # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is lag.id
enough to identify the port channel or would it be easier to the user to have a devicename (or switchport) + port name to find the offending entity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean lag.id is the primary key in the database table and netbox won't create any duplicate (device_name, interface_name)
. I wouldn't see a reason to use anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just thinking about the error message displayed to the user. Using lag.id
as dict key totally makes sense to me.
dbfb755
to
0f9f8b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error message with extra details is kinda optional for me
We need to force the speed on some breakout/QSA interfaces. As port-channel members are just plain strings, we add the speed to the port-channel interfaces itself. That is fine, as members can only be of the same speed anyway. For physical interfaces, we can annotate it straight to the interface.
0f9f8b7
to
1d254a4
Compare
We need to force the speed on some breakout/QSA interfaces. As
port-channel members are just plain strings, we add the speed to the
port-channel interfaces itself. That is fine, as members can only be of
the same speed anyway. For physical interfaces, we can annotate it
straight to the interface.