From 3b0686ffe826c7772d028ea8c0d1eda3cb8cd6c3 Mon Sep 17 00:00:00 2001 From: Deepak Agrawal Date: Thu, 22 Feb 2018 20:20:49 +0530 Subject: [PATCH] vyos_config IndexError in sanitize_config (#36375) (#36566) * Bug in del(list) logic. Say you have a list of 4 elements a[0-3] and you have to remove index 1 and 3, if you remove index 1 first then list is cut short a[0-2] and does not have index 3 Fix: Remove indexes in reverse sorted order e.g. 3 and 1 in above example so that order of indexes remain preserved even after deleting fix is to remove indexes in reverse sorted order * Add test cases for failed case (cherry picked from commit 0bbea9a57973ddfadbe1e5f456fa57c23404ff9c) --- CHANGELOG.md | 2 ++ lib/ansible/modules/network/vyos/vyos_config.py | 6 +++++- .../vyos_config/tests/cli/check_config.yaml | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e208adf0ce..a68f8884b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,8 @@ Ansible Changes By Release * Fix using ansible_*_interpreter on Python3 with non-new-style modules (old-style ansible python modules, modules written in another language, etc) https://github.com/ansible/ansible/pull/36541 +* Fix vyos_config IndexError in sanitize_config + (https://github.com/ansible/ansible/issues/36351)