mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Assume empty files are unencrypted.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user