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

Never sort port lists during rendering #90

Merged
merged 1 commit into from
Jan 25, 2017
Merged

Conversation

mat128
Copy link
Contributor

@mat128 mat128 commented Jan 20, 2017

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

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")
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

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

Copy link
Contributor

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.

@godp1301 godp1301 merged commit d697504 into internap:master Jan 25, 2017
@lindycoder
Copy link
Contributor

ffuuuuuuu

@lindycoder
Copy link
Contributor

lindycoder commented Jan 25, 2017

please open the issue to strip down to 80 characters now...

@godp1301
Copy link
Contributor

What i thought it was approved

mat128 pushed a commit to mat128/fake-switches that referenced this pull request Jan 26, 2017
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
mat128 pushed a commit that referenced this pull request Jan 26, 2017
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
FrancoisLopez pushed a commit to FrancoisLopez/fake-switches that referenced this pull request May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants