-
Notifications
You must be signed in to change notification settings - Fork 26
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
tagged port set untagged vlan fails #36
Comments
Further testing: when this is the config: trunk vlan allowed 888,999 Then I get the following for iface.vlan_trunks: Get() vlan_trunks: [<pyaoscx.vlan.Vlan object at 0x7fcb5b79b150>, <pyaoscx.vlan.Vlan object at 0x7fcb5b799290>] I.e. is appears that 'trunk vlan allowed all' produces an empty set, where specific allowed vlans is OK... Is this expected behaviour? and if so, should interface.py be adjusted to account for that ? |
Hi johan, Yes after a quick look, there is no check when using all vlan (vlan_trunks is empty array) -> https://github.com/aruba/pyaoscx/blob/master/pyaoscx/interface.py#L1568 -> need to modified this @alvinc13 Do you have try to use configure_l2_interface ? ansible module is this |
I've worked around this. My applications reads all interfaces from Interfaces().get_facts(). This is then cached as needed. Note that get_facts() expands the vlans allowed, and returns 'vlan_trunks' not as [], but as a dict() with each allowed vlan as key. So when I change an interface with .get() I am now looping through those allowed vlans and adding, similar to below: trunk_vlans = [] iface.vlan_trunks = vlan_trunks This works. I still think you do need to fix the set_native_vlan() code in the interface.py module, similar to what is in configure_l2_interface() |
Yes, need to be fixed ! |
Trying to set a new untagged vlan on a tagged port:
Hardware: CX6300, running 10.13.xxxx
Base config:
After using following code fragment below, port has all vlans removed, except for untagged:
Here is the code fragment:
This appears to be because the "iface.vlan_trunks" never gets set (materialized?), and therefor the iface.set_native_vlan() behaves by adding only the new vlan (see interface.py)
Program output:
Get() vlan_trunks: []
Get(selector) vlan_trunks: []
I have tried this with various selector types ("configuration", "writable"), but it makes no difference...
So, how do I get an Interface() object properly materialized to be able to make this change ?
In reference, this is to support the AOS-CX driver in
https://github.com/openl2m/openl2m/blob/development/openl2m/switches/connect/aruba_aoscx/connector.py
The text was updated successfully, but these errors were encountered: