When a switch does not let the user have access to all ports, the switch can crash trying to access the port.
If the port the user has access to has a numeric value greater than the total number of ports it has access to, the script throws an exception.
Instead of naively comparing switch port to switchs length, we iterate all ports and compare number.
Example:
Switch grants the user access to Port 5 only.
PowerSwitch.repr displays the port correctly.
PowerSwitch.status(5) or PowerSwitch.status('name') throws exception stating port is out of range.
Coverage decreased (-1.7%) to 77.891% when pulling 17de31e792257623cc0245add29d00ea3f06add4 on cclose:master into 1da2fdf5a962cb5b1f4050c51ea09ee1ae0dd97e on dwighthubbard:master.
When a switch does not let the user have access to all ports, the switch can crash trying to access the port. If the port the user has access to has a numeric value greater than the total number of ports it has access to, the script throws an exception.
Instead of naively comparing switch port to switchs length, we iterate all ports and compare number.
Example: Switch grants the user access to Port 5 only. PowerSwitch.repr displays the port correctly. PowerSwitch.status(5) or PowerSwitch.status('name') throws exception stating port is out of range.