Don't error out if the path to the backup setting file doesn't exist.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-08-22 02:28:37 -04:00
parent b5215b40c3
commit a33027dc39

View File

@@ -112,8 +112,14 @@ class Setting(object):
@classmethod
def save_configuration(cls, path=settings.CONFIGURATION_FILEPATH):
with open(path, 'w') as file_object:
file_object.write(cls.dump_data())
try:
with open(path, 'w') as file_object:
file_object.write(cls.dump_data())
except IOError as exception:
if exception.errno == errno.IONENT:
# The path for the configuration files doesn't exist.
# We can't save the backup file.
pass
@classmethod
def save_last_known_good(cls):