ansible-collections / arista.eos

Ansible Network Collection for Arista EOS
GNU General Public License v3.0
81 stars 64 forks source link

fix(eos_config): Handle multiline config for RCF "code unit" #526

Open ClausHolbechArista opened 2 months ago

ClausHolbechArista commented 2 months ago
SUMMARY

Fix error when configuring router control-functions by handling them as multiline inputs similar to how "banner" is handled.

Also added testing of multi line config. Using "banner" for this test, since RCF requires a much newer EOS version.

ISSUE TYPE
COMPONENT NAME

eos_config

ADDITIONAL INFORMATION

Fix handling of multi line config sections starting with "code unit" similar to how "banner" commands are handles.

Example of configuration failing today:

router general
   control-functions
      code unit MYUNIT1
         function ACCEPT_ALL() {
           return true;
           }
         EOF
      compile
      commit

Without this fix, the module returns an error:

fatal: [leaf1-dc1]: FAILED! => { "changed": false, "module_stderr": "Invalid input (at token 0: 'function')", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error" }
softwarefactory-project-zuul[bot] commented 2 months ago

Build failed. https://ansible.softwarefactory-project.io/zuul/buildset/76828ba3d5e24aabba4b0dea0df56d94

:x: ansible-test-network-integration-eos-httpapi-python39-stable215 FAILURE in 15m 05s :heavy_check_mark: ansible-test-network-integration-eos-httpapi-python39-stable214 SUCCESS in 45m 14s :heavy_check_mark: ansible-test-network-integration-eos-httpapi-python39-stable213 SUCCESS in 41m 20s :heavy_check_mark: ansible-test-network-integration-eos-httpapi-python39-stable212 SUCCESS in 35m 17s :heavy_check_mark: ansible-test-network-integration-eos-httpapi-python39-stable211 SUCCESS in 41m 05s :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable215-scenario01 SUCCESS in 33m 46s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable215-scenario02 SUCCESS in 31m 24s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario01 SUCCESS in 40m 17s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario02 SUCCESS in 36m 39s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable214-scenario01 SUCCESS in 38m 11s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable214-scenario02 SUCCESS in 35m 55s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario01 SUCCESS in 33m 31s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario02 SUCCESS in 35m 33s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable213-scenario01 SUCCESS in 37m 53s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable213-scenario02 SUCCESS in 35m 24s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario01 SUCCESS in 39m 37s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario02 SUCCESS in 36m 35s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable212-scenario01 SUCCESS in 37m 28s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable212-scenario02 SUCCESS in 36m 02s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario01 SUCCESS in 38m 43s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario02 SUCCESS in 35m 34s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable211-scenario01 SUCCESS in 39m 17s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable211-scenario02 SUCCESS in 35m 18s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario01 SUCCESS in 37m 24s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario02 SUCCESS in 36m 07s (non-voting) :heavy_check_mark: build-ansible-collection SUCCESS in 11m 50s :heavy_check_mark: ansible-tox-linters SUCCESS in 14m 12s :heavy_check_mark: ansible-galaxy-importer SUCCESS in 4m 22s

softwarefactory-project-zuul[bot] commented 2 months ago

Build failed. https://ansible.softwarefactory-project.io/zuul/buildset/1f0e02cdbb10420eab7e885f9d5127ac

:x: ansible-test-network-integration-eos-httpapi-python39-stable215 ERROR Failed to update project ansible/ansible in 3s :heavy_check_mark: ansible-test-network-integration-eos-httpapi-python39-stable214 SUCCESS in 44m 33s :x: ansible-test-network-integration-eos-httpapi-python39-stable213 ERROR Failed to update project ansible/ansible in 6s :x: ansible-test-network-integration-eos-httpapi-python39-stable212 ERROR Failed to update project ansible/ansible in 4s :heavy_check_mark: ansible-test-network-integration-eos-httpapi-python39-stable211 SUCCESS in 36m 06s :heavy_check_mark: ansible-test-network-integration-eos-network_cli-python39-stable215-scenario01 SUCCESS in 33m 58s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable215-scenario02 ERROR Failed to update project ansible/ansible in 3s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario01 SUCCESS in 34m 02s (non-voting) :x: ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario02 ERROR Failed to update project ansible/ansible in 5s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable214-scenario01 ERROR Failed to update project ansible/ansible in 4s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable214-scenario02 ERROR Failed to update project ansible/ansible in 5s (non-voting) :x: ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario01 ERROR Failed to update project ansible/ansible in 7s (non-voting) :x: ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario02 ERROR Failed to update project ansible/ansible in 6s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable213-scenario01 ERROR Failed to update project ansible/ansible in 7s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable213-scenario02 ERROR Failed to update project ansible/ansible in 5s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario01 SUCCESS in 33m 32s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario02 SUCCESS in 30m 46s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable212-scenario01 ERROR Failed to update project ansible/ansible in 8s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable212-scenario02 ERROR Failed to update project ansible/ansible in 5s (non-voting) :x: ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario01 ERROR Failed to update project ansible/ansible in 3s (non-voting) :x: ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario02 ERROR Failed to update project ansible/ansible in 5s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable211-scenario01 ERROR Failed to update project ansible/ansible in 5s (non-voting) :x: ansible-test-network-integration-eos-network_cli-python39-stable211-scenario02 ERROR Failed to update project ansible/ansible in 5s (non-voting) :heavy_check_mark: ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario01 SUCCESS in 37m 56s (non-voting) :x: ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario02 ERROR Failed to update project ansible/ansible in 5s (non-voting) :heavy_check_mark: build-ansible-collection SUCCESS in 9m 44s :heavy_check_mark: ansible-tox-linters SUCCESS in 11m 47s :heavy_check_mark: ansible-galaxy-importer SUCCESS in 4m 50s