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:
parent
719367facb
commit
9686695170
1 changed files with 5 additions and 1 deletions
|
@ -51,7 +51,11 @@ def is_encrypted(filename):
|
||||||
|
|
||||||
# read first line of the file
|
# read first line of the file
|
||||||
with open(filename) as f:
|
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):
|
if head.startswith(HEADER):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue