summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGomathiselviS <gomathiselvi@gmail.com>2021-03-25 21:06:01 -0400
committerGitHub <noreply@github.com>2021-03-26 01:06:01 +0000
commitc936f0c6d7138e23f4d8c14c4bb1c5727ab303fc (patch)
tree84f3406b82b193477311737d01cf0fa833ac51a9
parentc3b2d036bd0c0bf8d338123375a7bcc7de809f34 (diff)
downloadvyos-ansible-collection-c936f0c6d7138e23f4d8c14c4bb1c5727ab303fc.tar.gz
vyos-ansible-collection-c936f0c6d7138e23f4d8c14c4bb1c5727ab303fc.zip
Add regex to match the 'delete' failures (#134)
Add regex to match the 'delete' failures Reviewed-by: https://github.com/apps/ansible-zuul
-rw-r--r--changelogs/fragments/terminal_stderr_delete.yml3
-rw-r--r--plugins/terminal/vyos.py1
-rw-r--r--tests/integration/targets/vyos_system/tests/cli/basic.yaml2
-rw-r--r--tests/integration/targets/vyos_system/tests/cli/net_system.yaml2
4 files changed, 8 insertions, 0 deletions
diff --git a/changelogs/fragments/terminal_stderr_delete.yml b/changelogs/fragments/terminal_stderr_delete.yml
new file mode 100644
index 0000000..b886a3d
--- /dev/null
+++ b/changelogs/fragments/terminal_stderr_delete.yml
@@ -0,0 +1,3 @@
+---
+minor_changes:
+ - Add regex for delete failures to terminal_stderr_re
diff --git a/plugins/terminal/vyos.py b/plugins/terminal/vyos.py
index bf9d87b..0b5e74b 100644
--- a/plugins/terminal/vyos.py
+++ b/plugins/terminal/vyos.py
@@ -38,6 +38,7 @@ class TerminalModule(TerminalBase):
re.compile(br"\n\s*Invalid command:"),
re.compile(br"\nCommit failed"),
re.compile(br"\n\s+Set failed"),
+ re.compile(br"\n\s+Delete failed"),
]
ansi_re = TerminalBase.ansi_re + [
diff --git a/tests/integration/targets/vyos_system/tests/cli/basic.yaml b/tests/integration/targets/vyos_system/tests/cli/basic.yaml
index 9c3c09f..29309e2 100644
--- a/tests/integration/targets/vyos_system/tests/cli/basic.yaml
+++ b/tests/integration/targets/vyos_system/tests/cli/basic.yaml
@@ -2,6 +2,7 @@
- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}"
- name: setup
+ ignore_errors: true
vyos.vyos.vyos_config:
lines:
- delete system name-server 192.0.2.1
@@ -51,6 +52,7 @@
- result.commands[0] is search("delete system name-server '192.0.2.3'")
- name: teardown
+ ignore_errors: true
vyos.vyos.vyos_config:
lines:
- delete system name-server name-server 192.0.2.1
diff --git a/tests/integration/targets/vyos_system/tests/cli/net_system.yaml b/tests/integration/targets/vyos_system/tests/cli/net_system.yaml
index 3e68d20..758ba40 100644
--- a/tests/integration/targets/vyos_system/tests/cli/net_system.yaml
+++ b/tests/integration/targets/vyos_system/tests/cli/net_system.yaml
@@ -3,6 +3,7 @@
}}"
- name: setup
+ ignore_errors: true
vyos.vyos.vyos_config:
lines:
- delete system name-server 192.0.2.1
@@ -20,6 +21,7 @@
- result.commands[0] is search("set system name-server '192.0.2.1'")
- name: setup
+ ignore_errors: true
vyos.vyos.vyos_config:
lines:
- delete system name-server 192.0.2.1