fix wallet directory not being created

This commit is contained in:
Jack Robison 2018-09-28 17:02:04 -04:00
parent bdf6887791
commit ca9d48d574
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 6 additions and 0 deletions

View file

@ -567,6 +567,10 @@ class Config:
os.makedirs(self['data_dir'])
return self['data_dir']
def ensure_wallet_dir(self):
if not os.path.isdir(self['lbryum_wallet_dir']):
os.makedirs(self['lbryum_wallet_dir'])
def get_log_filename(self):
"""
Return the log file for this platform.

View file

@ -290,6 +290,7 @@ class HeadersComponent(Component):
@defer.inlineCallbacks
def start(self):
conf.settings.ensure_wallet_dir()
if not os.path.exists(self.headers_dir):
os.mkdir(self.headers_dir)
if os.path.exists(self.old_file):
@ -336,6 +337,7 @@ class WalletComponent(Component):
@defer.inlineCallbacks
def start(self):
conf.settings.ensure_wallet_dir()
log.info("Starting torba wallet")
storage = self.component_manager.get_component(DATABASE_COMPONENT)
lbryschema.BLOCKCHAIN_NAME = conf.settings['blockchain_name']