You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On executing the playbook, this must create a rule as below,
IP Access List ACL-TEST
10 permit tcp host 192.168.2.1 eq 8082 host 192.168.1.1 log
ACTUAL RESULTS
TASK [Push ACL] *********************************************************************************************************************************
fatal: [TEST-EOS-DEVICE]: FAILED! => changed=false
module_stderr: port/proto not found
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
Below is an example for resolving port 8082 to a service name. As you can see port 8082 doesn't translate to a well defined service name. So we should handle this exception & continue using the port number instead of returning the exception to the user.
>>> import socket
>>> socket.getservbyport(8082)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: port/proto not found
The text was updated successfully, but these errors were encountered:
SUMMARY
EOS ACL module doesn't handle exception when translating a port of type int to a service name. The mapping can be found here https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
ISSUE TYPE
COMPONENT NAME
arista.eos v6.1.2
ANSIBLE VERSION
COLLECTION VERSION
OS / ENVIRONMENT
Affects all EOS versions
STEPS TO REPRODUCE
Define a test rule
Playbook to push the rule
EXPECTED RESULTS
On executing the playbook, this must create a rule as below,
ACTUAL RESULTS
ISSUE
The problem seems to be in https://github.com/ansible-collections/arista.eos/blob/main/plugins/module_utils/network/eos/config/acls/acls.py#L531. The code fails to handle the exception in the scenario that a socket lib fails to translate a port number to a service name for that service.
Below is an example for resolving port 8082 to a service name. As you can see port
8082
doesn't translate to a well defined service name. So we should handle this exception & continue using the port number instead of returning the exception to the user.The text was updated successfully, but these errors were encountered: