-
Notifications
You must be signed in to change notification settings - Fork 41
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
Never sort port lists during rendering #90
Conversation
Currently, the ports are sorted to ensure interface vlans are printed before physical interfaces. This sorting works on the port name and ends up returning ports like 1, 10, 11, 12, ... 2, 3, etc. This commit removes the sorting and uses proper switch_configuration methods to obtain physical interfaces vs interface vlans. This ensures the order specified in the configuration is kept as-is. Closes internap#88
@@ -194,7 +194,7 @@ def test_show_vlan_brief(self, t): | |||
t.readln("") | |||
t.readln("VLAN Name Status Ports") | |||
t.readln("---- -------------------------------- --------- -------------------------------") | |||
t.readln("1 default active Fa0/2, Fa0/3, Fa0/4") | |||
t.readln("1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12") |
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.
are you sure there's not an auto wrapping here?
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.
There is, based on terminal width, which we dont support right now. If you set your terminal to super large, you will get the above result.
I'm happy with the compromise for now.
other than that is assume a 80x24 terminal and always wrap, even on larger terminals.
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.
It may be a good idea for the future to always wrap at 80 as the idea is to test applications that should expect a line wrap in what the switch returns. But I don't think this is part of this review.
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.
Good remark. Will address in an upcoming change.
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.
Buuuuuut.... that's not how we assumed stuff up to now, this is made for testing automated tools, these tools usually use a defined screen size and may want to test with multiple lines in the port list
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've created an issue to reflect this behavior #97
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.
👍
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.
Why an issue? Why introduce an inconsistency?
To my knowledge we already wrap to 80 chars everywhere
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.
Oh! Then, if we already wrap to 80 chars everywhere, it must be taken care of in this review.
ffuuuuuuu |
please open the issue to strip down to 80 characters now... |
What i thought it was approved |
Currently, port names were written all on one line, as if the software connecting had defined a very long terminal. This is not always the case. Fake-switch should expose possible cases, such as port names wrapping on other lines. This commit adds this (missing) feature to the show vlan command. This is a follow up of internap#90. Partial-bug: internap#97
Currently, port names were written all on one line, as if the software connecting had defined a very long terminal. This is not always the case. Fake-switch should expose possible cases, such as port names wrapping on other lines. This commit adds this (missing) feature to the show vlan command. This is a follow up of #90. Partial-bug: #97
Made regex threadsafe
Currently, the ports are sorted to ensure interface vlans are printed
before physical interfaces. This sorting works on the port name and ends
up returning ports like 1, 10, 11, 12, ... 2, 3, etc.
This commit removes the sorting and uses proper switch_configuration
methods to obtain physical interfaces vs interface vlans. This ensures
the order specified in the configuration is kept as-is.
Closes #88