From c071d6a85cb797070fab87f4a49d1b18c0a4bdba Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 11 Nov 2014 09:39:03 -0500 Subject: [PATCH] switched to iterator as per comments --- lib/ansible/modules/system/hostname.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/hostname.py b/lib/ansible/modules/system/hostname.py index 48311f07a96..95b28dbf69d 100755 --- a/lib/ansible/modules/system/hostname.py +++ b/lib/ansible/modules/system/hostname.py @@ -313,7 +313,7 @@ class OpenRCStrategy(GenericStrategy): def set_permanent_hostname(self, name): try: f = open(self.HOSTNAME_FILE, 'r') - lines = [x.strip() for x in f] + lines = (x.strip() for x in f) for i, line in enumerate(lines): if line.startswith('hostname='):