Merge pull request #238 from lbryio/missing-conf
fix missing conf file on first run
This commit is contained in:
commit
fee6de1c1f
1 changed files with 2 additions and 3 deletions
|
@ -275,7 +275,7 @@ def update_settings_from_file(filename=None):
|
||||||
updates = load_settings(filename)
|
updates = load_settings(filename)
|
||||||
log.info("Loaded settings file: %s", updates)
|
log.info("Loaded settings file: %s", updates)
|
||||||
settings.update(updates)
|
settings.update(updates)
|
||||||
except OSError as ex:
|
except (IOError, OSError) as ex:
|
||||||
log.info('%s: Failed to update settings from %s', ex, filename)
|
log.info('%s: Failed to update settings from %s', ex, filename)
|
||||||
|
|
||||||
|
|
||||||
|
@ -290,8 +290,7 @@ settings_encoders = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def load_settings(path=None):
|
def load_settings(path):
|
||||||
path = path or settings.get_conf_filename()
|
|
||||||
ext = os.path.splitext(path)[1]
|
ext = os.path.splitext(path)[1]
|
||||||
with open(path, 'r') as settings_file:
|
with open(path, 'r') as settings_file:
|
||||||
data = settings_file.read()
|
data = settings_file.read()
|
||||||
|
|
Loading…
Reference in a new issue