From 6a46e3a44b41c2b8c4b74de5af42c1451f135f5b Mon Sep 17 00:00:00 2001 From: John R Barker Date: Fri, 11 May 2018 15:25:04 +0100 Subject: [PATCH] Backport/2.5/37847Fix interfaces_file to accept allow-* (#37847 (#40008) * Fix interfaces_file to accept allow-* (#37847) (cherry picked from commit 5ac41ee8d840f79e701f98499b3cd0793367fe54) * interfaces-file --- changelogs/fragments/interfaces_file-allow.yaml | 2 ++ lib/ansible/modules/system/interfaces_file.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/interfaces_file-allow.yaml diff --git a/changelogs/fragments/interfaces_file-allow.yaml b/changelogs/fragments/interfaces_file-allow.yaml new file mode 100644 index 00000000000..96326511773 --- /dev/null +++ b/changelogs/fragments/interfaces_file-allow.yaml @@ -0,0 +1,2 @@ +bugfixes: +- Fix interfaces_file to support `allow-` https://github.com/ansible/ansible/pull/37847 diff --git a/lib/ansible/modules/system/interfaces_file.py b/lib/ansible/modules/system/interfaces_file.py index a6a5d91b52b..ef68aa89b36 100755 --- a/lib/ansible/modules/system/interfaces_file.py +++ b/lib/ansible/modules/system/interfaces_file.py @@ -225,7 +225,7 @@ def read_interfaces_lines(module, line_strings): elif words[0] == "auto": lines.append(lineDict(line)) currently_processing = "NONE" - elif words[0] == "allow-": + elif words[0].startswith("allow-"): lines.append(lineDict(line)) currently_processing = "NONE" elif words[0] == "no-auto-down":