generate_secrets: Fix handling of an empty secrets file.

This is now a condition that happens during installation, because we
now create an empty file for this in puppet.
This commit is contained in:
Tim Abbott 2018-05-06 22:12:32 -07:00
parent dc0696af74
commit b3e4c702d1
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ def generate_django_secretkey():
def get_old_conf(output_filename):
# type: (str) -> Dict[str, Text]
if not os.path.exists(output_filename):
if not os.path.exists(output_filename) or os.path.getsize(output_filename) == 0:
return {}
secrets_file = configparser.RawConfigParser()