From 8d7efa7d32f13e9fa1d59278bad5e46d006143d7 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Mon, 18 Mar 2019 17:40:45 +0100 Subject: [PATCH] Strip whitespace when reading limit file (#53564) Fix #17088 --- lib/ansible/inventory/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/manager.py b/lib/ansible/inventory/manager.py index c08e4b8c19..dc3f57da44 100644 --- a/lib/ansible/inventory/manager.py +++ b/lib/ansible/inventory/manager.py @@ -608,7 +608,7 @@ class InventoryManager(object): for x in subset_patterns: if x.startswith("@"): fd = open(x[1:]) - results.extend(fd.read().split("\n")) + results.extend([l.strip() for l in fd.read().split("\n")]) fd.close() else: results.append(x)