1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Assume empty files are unencrypted.

This commit is contained in:
Michael DeHaan 2014-02-21 21:06:04 -05:00
parent 719367facb
commit 9686695170

View file

@ -51,7 +51,11 @@ def is_encrypted(filename):
# read first line of the file
with open(filename) as f:
head = f.next()
try:
head = f.next()
except StopIteration:
# empty file, so not encrypted
return False
if head.startswith(HEADER):
return True