From 89f91b1cd7ebb3373e11641843bd2334cffc5cd6 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 24 Aug 2016 10:57:35 -0700 Subject: [PATCH] The former match for a section header included hosts that began with a range. (#17225) Checking that the line ends with "]" narrows that window somewhat, Fixes #15331 --- lib/ansible/inventory/ini.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index defe0517a17..172f8d03513 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -124,7 +124,7 @@ class InventoryParser(object): del pending_declarations[groupname] continue - elif line.startswith('['): + elif line.startswith('[') and line.endswith(']'): self._raise_error("Invalid section entry: '%s'. Please make sure that there are no spaces" % line + \ "in the section entry, and that there are no other invalid characters")