Merge branch 'fix-missing-wallet-dir'

This commit is contained in:
Jack Robison 2018-10-02 11:06:59 -04:00
commit a88485c5a0
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']) os.makedirs(self['data_dir'])
return 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): def get_log_filename(self):
""" """
Return the log file for this platform. Return the log file for this platform.

View file

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