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:
@@ -112,8 +112,14 @@ class Setting(object):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def save_configuration(cls, path=settings.CONFIGURATION_FILEPATH):
|
def save_configuration(cls, path=settings.CONFIGURATION_FILEPATH):
|
||||||
|
try:
|
||||||
with open(path, 'w') as file_object:
|
with open(path, 'w') as file_object:
|
||||||
file_object.write(cls.dump_data())
|
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
|
@classmethod
|
||||||
def save_last_known_good(cls):
|
def save_last_known_good(cls):
|
||||||
|
|||||||
Reference in New Issue
Block a user