-
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
pyaoscx.mac.get_all not working when a VRRP is configured #24
Comments
@smirlach thank you for bringing this to our attention! I'll bring this up with the team and they'll work on reproducing the issue and looking into a resolution! I'll update this issue when an expected fix is to be posted! |
@smirlach Can you share the CLI configuration you're using to produce this issue? |
@tchiapuziowong I'm using
Do you need anything else specifically? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
i found an issue with getting the MAC addresses if a VRRP is configured and i would consider this as a bug. This is also used in other modules for example when getting a VLAN via
VLAN.get(session,vlan_id)
.When there is a VRRP configured for a VLAN the variable
mac['port']
equals None.pyaoscx/pyaoscx/mac.py
Line 214 in 648cfc7
As far is i know this is right as there is no logical or physical Port assigned to the virtual MAC address of the VRRP. Still this is leading to an error, because later on api.py tries to access the items of
mac['port']
.Before that the variable is handed over to interface.py as
response_data
:pyaoscx/pyaoscx/interface.py
Lines 365 to 382 in 648cfc7
After this
response_data
is handed over to api.py. Which finally tries to access the items ofresponse_data
which then leads to the Error "Ran into exception: 'NoneType' object has no attribute 'items'. Closing session."pyaoscx/pyaoscx/api.py
Lines 84 to 101 in 648cfc7
This happens because it is not checked at any point either if the current MAC address is a VRRP or if the port of the MAC address equals None. Those two points mentioned could also be a possible solution in my opinion which could be implemented via changing line 214 in mac.py to one of the following snippets:
Check if the port of the MAC address is None
Check if the given MAC address is configured via a VRRP
Those are just suggestions and i don't know if they are implemented in the right way to work for every usecase of pyaoscx.
The text was updated successfully, but these errors were encountered: