mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
make more python like
This commit is contained in:
parent
6ec527809e
commit
a750d2359f
@ -508,11 +508,8 @@ def contains(path, text):
|
||||
|
||||
try:
|
||||
with open(path, 'r') as fp_:
|
||||
while True:
|
||||
data = fp_.readline()
|
||||
if not data:
|
||||
break
|
||||
if text.strip() == data.strip():
|
||||
for line in fp_:
|
||||
if text.strip() == line.strip():
|
||||
return True
|
||||
return False
|
||||
except (IOError, OSError):
|
||||
|
Loading…
Reference in New Issue
Block a user