mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 16:36:29 +00:00
switched to iterator as per comments
This commit is contained in:
@@ -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='):
|
||||
|
||||
Reference in New Issue
Block a user